Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
fightcancer
Beginner


Joined: 01 Nov 2004
Posts: 17

PostPosted: Fri Nov 05, 2004 6:08 am   

Conditions & Triggers Question
 
My original question was whether we are allowed to stack conditions like this?
Code:
#TR {^Obvious exits:$} {ClearDir;PickDir;#ALARM "a1" +%random(5,9) {@ChosenDir}} "" {notrig}
#COND {^North  - *} {#ADDITEM PossDir North;#ADD DirCount 1} {within|Param=1}
#COND {^East   - *} {#ADDITEM PossDir East;#ADD DirCount 1} {within|Param=2}
#COND {^South  - *} {#ADDITEM PossDir South;#ADD DirCount 1} {within|Param=3}
#COND {^West   - *} {#ADDITEM PossDir West;#ADD DirCount 1} {within|Param=4}

So far, my experiments have shown it's possible, but that the 2nd condition is dependent on the first. Only if the first 3 conditions are true will the 4th one be executed.

I'm not sure why this is, but thought I'd post it as an FYI.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Nov 05, 2004 8:00 am   
 
Different states for a trigger are tested and fired sequentially, only 1 is active at any time. The counter for within is reset when each new state becomes active. So you can't stack them the way you want. What I would do is make 1 state handle all the directions.
Code:

#TR {^Obvious exits:$} {ClearDir;PickDir;#ALARM "a1" +%random(5,9) {@ChosenDir}} "" {notrig}
#COND {^({North|East|South|West})  - *} {#ADDITEM PossDir "%1";#ADD DirCount 1} {within|Param=4}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
fightcancer
Beginner


Joined: 01 Nov 2004
Posts: 17

PostPosted: Fri Nov 05, 2004 7:01 pm   
 
I hadn't thought of that. thanks! would the 2nd line get the direction? it looks like it's just gonna pull the info from the wildcard * rather than pulling N,E,S, or W.

Vijilante wrote:
What I would do is make 1 state handle all the directions.
Code:

#TR {^Obvious exits:$} {ClearDir;PickDir;#ALARM "a1" +%random(5,9) {@ChosenDir}} "" {notrig}
#COND {^({North|East|South|West})  - *} {#ADDITEM PossDir "%1";#ADD DirCount 1} {within|Param=4}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net