 |
Edwub Wanderer
Joined: 21 Nov 2002 Posts: 85 Location: USA
|
Posted: Tue Dec 10, 2002 2:21 am
#add command |
Hello Zmud Users,
I'm using triggers/vars to keep track of my wand/staff charges left. (#add command)
How do I add a limit factor so that it won't let the variable number go below 0 or above 10?
Thank you,
Edwub the Mage |
|
|
|
 |
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Tue Dec 10, 2002 2:47 am |
Something like this should work, if I understand you correctly:
#TRIGGER {Your staff has been recharged.) {#VAR ChargesLeft 10}
#TRIGGER {Your staff gains a charge.} {#ADD ChargesLeft 1;#IF (@ChargesLeft > 10) {#VAR ChargesLeft 10}}
#TRIGGER {You use a charge of your staff.} {#ADD ChargesLeft -1;#IF (@ChargesLeft < 0) {#VAR ChargesLeft 0}}
Modify the patterns as appropriate, of course.
- Charbal |
|
|
|
 |
Edwub Wanderer
Joined: 21 Nov 2002 Posts: 85 Location: USA
|
Posted: Tue Dec 10, 2002 3:47 am |
Works like a charm, really simple too, just use if and > <. Whee =)
Thanks,
Edwub the Mage |
|
|
|
 |
|
|
|