sui Newbie
Joined: 07 Feb 2003 Posts: 8
|
Posted: Mon Feb 17, 2003 4:06 pm
Triggers interfeering with eachother, problem |
I run into the following problem:
Basically i have 3 triggers, which normally shouldn't interfeer with eachother, but when one of them is triggerd before the other, it makes the second one trigger twice. I will post the triggers code and some mud output followed by a minor observation. PLEASE HELP, I AM DISPERATE!
Trigger No. 1:
Pattern:
There are (%w) exits: (%*)and (%w)~.
Commands:
#say Trigger No. 1
UDnumexits=0
UDexits=""
#var UDtmp {%{2}%{3}} _nodef UDMapping
#if (%1==two) {
UDnumexits=%numwords( @UDtmp, " ")
#repeat @UDnumexits {
#say additem UDexits %word( @UDtmp, %repeatnum, " ")
}
} {
UDnumexits=%numwords( @UDtmp, ", ")
#repeat @UDnumexits {
#say additem UDexits %word( @UDtmp, %repeatnum, ", ")
}
}
Trigger No. 2:
Pattern:
There is one obvious exit: (%w)~.
Commands:
#say Trigger No. 2
UDexits=""
UDnumexits=1
#say additem UDexits %1
Trigger No. 3:
Pattern:
^Wanderer crawls in from the (%w)~.$
Commands:
#say Trigger No. 3
;ret_dir %1 UDlastdir
UDlastretdir=%1
;STpush @UDlastdir STdirect
;STpush @UDlastretdir STreturn
#if (@UDlastdir=~west) {UDdx=-1} {
#if (@UDlastdir=~east) {UDdx=1} {UDdx=0}}
#if (@UDlastdir=~north) {UDdy=1} {
#if (@UDlastdir=~south) {UDdy=-1} {UDdy=0}}
#add UDx @UDdx
#add UDy @UDdy
#add UDz @UDdz
#var UDtmp1 {%delitem( @UDlastretdir, @UDexits)} _nodef UDMapping
#if (@UDjust_arrived=1) {
; STpush @UDtmp1 STavail_exits
UDjust_arrived=0
}
Ok, separately, these triggers work great, but when Trigger No. 1 is triggerd before Trigger No. 3, the second one is triggerd twice. I will post some Mud output:
lead se
You are confident that you are at about the same level as before.
An extremely small tunnel
You are deep underground in a extremely small rocky tunnel. The ceiling here is extremely high. It is bright here.
There are three exits: east, south, and northwest.
Trigger No. 1
additem UDexits east
additem UDexits south
Wanderer crawls in from the northwest.
Trigger No. 3
> additem UDexits northwest
Trigger No. 3
You say (OOC), 'Here, Trigger No. 3 is triggerd twice'
> lead nw
You are confident that you are at about the same level as before.
A somewhat large tunnel
You are deep underground in a somewhat large rocky tunnel. The ceiling here is extremely high. The air is very moist here. It is bright here.
There is one obvious exit: southeast.
Trigger No. 2
additem UDexits southeast
Wanderer crawls in from the southeast.
Trigger No. 3
You say (OOC), 'here Trigger No. 3 is triggerd only once as it should be'
Now, one final observation, the only important difference that i noticed between the 2 cases above, is this:
Trigger 1 and 3 case(it happens in a room with more then one exit):
It seems that after trigger 1 is triggerd, and starts processing the exits, trigger 3 is triggerd before trigger 1 finishes(as you can see in the mud output). This could mean nothing but i just though to mention it, in case it DOES mean something.
Trigger 2 and 3 case(happens whne the room has only 1 exit):
Trigger 2 starts and finishes before trigger 3 is triggerd. In this case trigger 3 is executed only once.
I would REALLY apreciate some help!
Thanks,
Player of Sui. |
|