ID:179878
 
This is got to be the dumbest question ever but how do I make it so I can have a var that depends on your level multiply by 10? like if I want my MP to go up when I drink some thing
TK6000 wrote:
This is got to be the dumbest question ever but how do I make it so I can have a var that depends on your level multiply by 10? like if I want my MP to go up when I drink some thing


You would use the multiply(*) operator so something like this:

mob
var
Something = 1
mob/verb/Multiply_Something()
usr.Something * 10
usr<<"Your something is now [Something]"
In response to Nadrew
Thanks a lot!
In response to TK6000
Now how do I devide?
In response to TK6000
* = Multiplication
+ = Addition
- = Subtraction
/ = Division
In response to Alathon
Alathon wrote:
* = Multiplication
+ = Addition
- = Subtraction
/ = Division

As explained in the Blue Book.

Given the level of these questions, you'll save yourself and everyone a lot of time if you get the Blue Book.
In response to Deadron
Deadron wrote:
Alathon wrote:
* = Multiplication
+ = Addition
- = Subtraction
/ = Division

As explained in the Blue Book.

Given the level of these questions, you'll save yourself and everyone a lot of time if you get the Blue Book.

And while you're waiting for the book to arrive, click on the word "Reference" under "Developers" on the left. You'll be amazed at how much help is in there. This topic is answered under "Operator," where it explains the following DM operators:

[] () . / :
~ ! - ++ --
**
* / %
+ -
< <= > >=
<< >>
== != <>
& ^ |
&&
||
?
= += -= *= /= &= |= ^= <<= >>=

If you want to know what the rest of this fun stuff is, take a peek!
In response to Skysaw
Skysaw wrote:
Deadron wrote:
Alathon wrote:
* = Multiplication
+ = Addition
- = Subtraction
/ = Division

As explained in the Blue Book.

Given the level of these questions, you'll save yourself and everyone a lot of time if you get the Blue Book.

And while you're waiting for the book to arrive, click on the word "Reference" under "Developers" on the left. You'll be amazed at how much help is in there. This topic is answered under "Operator," where it explains the following DM operators:

[] () . / :
~ ! - ++ --
**
* / %
+ -
< <= > >=
<< >>
== != <>
& ^ |
&&
||
?
= += -= *= /= &= |= ^= <<= >>=

If you want to know what the rest of this fun stuff is, take a peek!


And for quick access to these things without having to goto the reference press F1 in Dream Maker its basicly the same as the reference but quicker in some situations.
In response to Nadrew
Wow thanks a lot. I am going to get that book. Thanks agen!
In response to Nadrew
mob
var
Something = 1
mob/verb/Multiply_Something()
usr.Something * 10
usr<<"Your something is now [Something]"


WRONG!

mob
var
level = 1 as num
mpplus = 0 as num
mp = 50 as num
verb
Drink_Potion()
src.mpplus = src.level * 10
src.mp += src.mpplus
src << "You gain [src.mpplus] MP. Your MP is now [src.mp]"


Good luck!
In response to Lord of Water
Lord of Water wrote:
> mob
> var
> Something = 1
> mob/verb/Multiply_Something()
> usr.Something * 10
> usr<<"Your something is now [Something]"
>

WRONG!

> mob
> var
> level = 1 as num
> mpplus = 0 as num
> mp = 50 as num
> verb
> Drink_Potion()
> src.mpplus = src.level * 10
> src.mp += src.mpplus
> src << "You gain [src.mpplus] MP. Your MP is now [src.mp]"
>

Good luck!

Nadrew's would have been fine if he had used *= instead of *.

Yours, on the other hand, is a bit more problematic. First, you forgot to indent under Drink_Potion(). Second, why is that a mob verb? It should belong to a potion, otherwise the user can drink a non-existant potion at any time, continually jacking up their "mp." Third, "as num" does nothing here; you've already assigned a number in the initial declaration.
In response to Skysaw
Heh, sorry about indentation! I always define a variable if I can. It's a habit. And, I did not expect him to use THIS code, I expected him to look at it and learn from it.

Good day.
In response to Lord of Water
Lord of Water wrote:
Heh, sorry about indentation! I always define a variable if I can. It's a habit. And, I did not expect him to use THIS code, I expected him to look at it and learn from it.

Good day.

Those are some lofty expectations! It's a world of cut-and-paste, I'm afraid.