|
fightcancer Beginner
Joined: 01 Nov 2004 Posts: 17
|
Posted: 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. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
fightcancer Beginner
Joined: 01 Nov 2004 Posts: 17
|
Posted: 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}
|
|
|
|
|
|
|
|