|
soldado_del_rey Newbie
Joined: 23 Dec 2003 Posts: 7 Location: USA
|
Posted: Tue Dec 23, 2003 2:49 am
Conditional Triggers? |
I've read through all the documentation I can find and haven't been able to figure out how to do this...
I have the variable @anorexia, defaulted to 0
I want it to automatically add 1 to the variable @vlock whenever @anorexia
changes to 1, and the same in reverse, when @anorexia reverts to 0, I want
1 to be subtracted from @vlock.
Nothing I've tried so far will work. |
|
|
|
Toetag Magician
Joined: 10 Oct 2000 Posts: 356 Location: USA
|
Posted: Tue Dec 23, 2003 3:30 am |
why conditionals?
#IF (vlock=1) {anorexia=1)
#IF (vlock=0) {anorexia=0) |
|
|
|
soldado_del_rey Newbie
Joined: 23 Dec 2003 Posts: 7 Location: USA
|
Posted: Tue Dec 23, 2003 3:35 am |
quote: Originally posted by Toetag
why conditionals?
#IF (vlock=1) {anorexia=1)
#IF (vlock=0) {anorexia=0)
I need it to do that whenever the variable changes, not just when I input an IF statement. |
|
|
|
Glinka Wanderer
Joined: 20 Dec 2000 Posts: 53 Location: USA
|
Posted: Tue Dec 23, 2003 6:28 am |
What triggers the variables to be updated?
are the only two states for them zero and one?
If you have a trigger somewhere that adds
an amount to the anorexia variable, then the
previous statements could be added there.
or just update both at the same time...
example:
#trigger Your suffer bloodloss
value: @anorexia=1
@vlock=1
#trigger You feel better
value: @anorexia=0
@vlock=0
for more than just zero and one, you may need the #math command,
or perhaps if they Allways match
@vlock=@anorexia
Hope this helps,
G |
|
|
|
Serentus Apprentice
Joined: 28 Sep 2001 Posts: 103 Location: USA
|
Posted: Tue Dec 23, 2003 10:44 am |
TRY
#FUNC vlock {%eval(@anoexia+@slick+@asthma)}
This should give you the sum of those variables when ever you check @vlock. So if you are slick with asthma @vlock will equal 2, if @anorexia then is set 1 @vlock will be 3. if then asthma is cured and goes back to 0 then @vlock will be 2 agian.
I think this what your wanting, try being a bit more specific, then someone not familiar with your MUD (i'm guessing an Iron Realms game) can help you better. If i'm wrong then post more info. |
|
|
|
soldado_del_rey Newbie
Joined: 23 Dec 2003 Posts: 7 Location: USA
|
Posted: Tue Dec 23, 2003 2:49 pm |
quote: Originally posted by Serentus
TRY
#FUNC vlock {%eval(@anoexia+@slick+@asthma)}
This should give you the sum of those variables when ever you check @vlock. So if you are slick with asthma @vlock will equal 2, if @anorexia then is set 1 @vlock will be 3. if then asthma is cured and goes back to 0 then @vlock will be 2 agian.
I think this what your wanting, try being a bit more specific, then someone not familiar with your MUD (i'm guessing an Iron Realms game) can help you better. If i'm wrong then post more info.
That sounds close to what I want, is the function always active, or do I need to activate it manually or with an alias?
And yes, it's an Iron Realms game, Aetolia. |
|
|
|
Serentus Apprentice
Joined: 28 Sep 2001 Posts: 103 Location: USA
|
Posted: Wed Dec 24, 2003 3:01 am |
As long as the class is active then the function will update, you use it just like a variable.
#IF (@vlock=3) {You are LOCKED} {You are not completly locked}
you could also try #FUNC vlock {%if((@anorexia and @slick and @asthma),1,0)}
then @vlock will equal 1 if you have all three or 0 if you don't then it could be used as.
#IF (@vlock) {You are locked} {you are not locked}
I don't really know how you want to used it. |
|
|
|
soldado_del_rey Newbie
Joined: 23 Dec 2003 Posts: 7 Location: USA
|
Posted: Sat Dec 27, 2003 12:48 am |
quote: Originally posted by Serentus
As long as the class is active then the function will update, you use it just like a variable.
#IF (@vlock=3) {You are LOCKED} {You are not completly locked}
you could also try #FUNC vlock {%if((@anorexia and @slick and @asthma),1,0)}
then @vlock will equal 1 if you have all three or 0 if you don't then it could be used as.
#IF (@vlock) {You are locked} {you are not locked}
I don't really know how you want to used it.
Thanks man, that worked perfectly. |
|
|
|
|
|