|
Lina Novice
Joined: 12 Oct 2006 Posts: 49
|
Posted: Thu Oct 12, 2006 3:18 am
Using variable in #IF |
Hi,
I'm not sure if I'm just not seeing the problem, but I've been on this for hours now and it's 4am now.
In Zmud, one could make a trigger
#TR {Trigger on this line} {#IF (@action) {@action}}
and if the action variable has something in it, it will trigger.
In Cmud, I've been trying to get a similar effect, however the #IF statement with the (@action) check, only appears to work if the action variable is an integer, but not a word/string. I've tried changing the different variable types as well, no difference.
Does this mean I cannot use that sort of check anymore for Cmud and should look for a different way of scripting that, or is it just a variable problem?
Thanks! |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Oct 12, 2006 4:03 am |
Yep, this is a bug in 1.09. It's mentioned in my blog entry for v1.10 and is already fixed for the 1.10 version. You were correct that it was a problem with non-integer variables.
|
|
|
|
Lina Novice
Joined: 12 Oct 2006 Posts: 49
|
Posted: Thu Oct 12, 2006 12:47 pm |
Thanks!
|
|
|
|
BlackSmith Apprentice
Joined: 08 Dec 2002 Posts: 152
|
Posted: Thu Oct 12, 2006 8:13 pm |
Apropro, would #If (@Boolean = true/false) work in 1.09? Because adding that small extra valuation there would not be such a too-big thing to do and it would allow me to start really use cMud.
|
|
_________________ BatMUD Best MMORPG around since 1990 telnet://bat.org:23
~ Magic & Mind beats Chrome & Meat anytime ~
Pattern(s) in PERL. Using Cmud 1.34/2.09 & BatClient. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Thu Oct 12, 2006 9:49 pm |
as an aside, why use #if (@boolean = true/false)?
a boolean is either true or false anyway, so you can just do #if (@boolean) or #if (!@boolean) and you'll get the same result and save time in comparisons |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
BlackSmith Apprentice
Joined: 08 Dec 2002 Posts: 152
|
Posted: Mon Oct 16, 2006 1:27 pm |
Guinn wrote: |
as an aside, why use #if (@boolean = true/false)? |
Read Zugg's response and you understand why.
|
|
_________________ BatMUD Best MMORPG around since 1990 telnet://bat.org:23
~ Magic & Mind beats Chrome & Meat anytime ~
Pattern(s) in PERL. Using Cmud 1.34/2.09 & BatClient. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Oct 16, 2006 4:27 pm |
Of course, this should be working in 1.10 now, so you shouldn't need the #if (@boolean = true/false) syntax. And that syntax will just cause your scripts to be a bit slower.
|
|
|
|
|
|