 |
Killfile Novice
Joined: 30 Sep 2002 Posts: 32 Location: USA
|
Posted: Mon Sep 30, 2002 1:49 pm
Setting Variables wih If |
I'm trying to create an if statment which will watch a variable and act on that variable when certain conditions are met.
The variable in question is something called "GasLeft" which is an integer value I am decrimenting each time I cast a spell. However, I don't want this value to dip below -25. My current function is
%if(@GasLeft < -25,GasLeft = 8)
The problem is that when the conditional is met instead of seting GasLeft equal to 8 it sends "GasLeft = 8" to the mud, which has no idea what I'm talking about.
How do I get Zmud to evaluate this numeric expression rather than deciding it is an actual command?
--Killfile |
|
|
 |
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Mon Sep 30, 2002 4:24 pm |
#IF is a command which executes a command.
%if is a function which returns a value.
You can do what you want using either:
#IF (@GasLeft < -25) {Gasleft = 8}
or
#VAR GasLeft %if(@GasLeft < -25, 8, @GasLeft)
Note that you MUST provide a false-value if you use the %if function. In this case I used @GasLeft.
Troubadour
(Win 98, Pentium III, 550 MHz) |
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|