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
Illogic
Beginner


Joined: 11 Nov 2006
Posts: 13

PostPosted: Sat Nov 11, 2006 11:53 pm   

cant figure out why??!!?? trigger problems
 
i have two triggers:



-1st trigger-

pattern:
You are now riding across a plain.
ID: east

commands:
clear
east 10000
#T- east
#T+ west

-2nd trigger-

pattern:
You are now riding across a plain.
ID: west

commands:
clear
west 10000
#T- west
#T+ east




basically im trying to make the trigger alternate between each other when the same pattern comes up..1 trigger turns the other off and executes..pattern comes up again...trigger activate other and executes..etc..etc

but for some reason when the pattern comes up the first trigger will execute fine, but after that each time the pattern shows up the triggers both execute..and i have no idea why..any help ?
Reply with quote
darkspot
Apprentice


Joined: 29 Jul 2002
Posts: 105

PostPosted: Sun Nov 12, 2006 12:37 am   
 
you may have multiple aliases/triggers/etc with all the name east That's the first thing that comes to my mind.
Reply with quote
Illogic
Beginner


Joined: 11 Nov 2006
Posts: 13

PostPosted: Sun Nov 12, 2006 7:08 am   
 
nope...one trigs id is west,,the others id is east
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Nov 12, 2006 5:45 pm   
 
It is because when a trigger is enabled it is inserted into the testing list. I would suggest using a variable to control your direction instead.

#VARIABLE Direction {0}
#TRIGGER {You are now riding across a plain.} {clear;#IF (@Direction) {east 10000} {west 10000};Direction=%eval(!@Direction)}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Illogic
Beginner


Joined: 11 Nov 2006
Posts: 13

PostPosted: Sun Nov 12, 2006 10:12 pm   
 
man...thats way more complicated then zmud 5.54...


thanks though
Reply with quote
Illogic
Beginner


Joined: 11 Nov 2006
Posts: 13

PostPosted: Sun Nov 12, 2006 11:20 pm   
 
thanks a lot it worked...but im curious as to how @direction alternates between true and false
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Nov 13, 2006 2:59 am   
 
Quote:

Direction=%eval(!@Direction)


From this part. The ! is the shortcut for logical NOT. If @direction = 1, then the %eval(!@direction) becomes %eval(NOT 1), which would equate to 0. When @direction = 0, then it becomes NOT 0, which equates to any non-zero number (specifically 1 or -1, I think).
_________________
EDIT: I didn't like my old signature
Reply with quote
Illogic
Beginner


Joined: 11 Nov 2006
Posts: 13

PostPosted: Mon Nov 13, 2006 4:41 am   
 
wow complex..thanks for explaining that


but now that bring me to something else


is there a way i can store the way im going in a variable


ie: i come to the plains and it sends east 10000 to the mud which makes me travel east for 10000 feet


now when i encounter a mob on the way i kill that mob and the mud displays:


the ogre's body goes limp


is there a way i can store the direction i was travelling so that when the mud receives (body goes limp) it will send east 10000 again ? or if i was going west then west 10000


thanks for all the help
Reply with quote
Illogic
Beginner


Joined: 11 Nov 2006
Posts: 13

PostPosted: Mon Nov 13, 2006 4:44 am   
 
also im interested in learning how to do all this on my own. are zmud triggers C or C++ or is there some kind of coding newbie guide i can read? the help is a bit confusing
Reply with quote
Illogic
Beginner


Joined: 11 Nov 2006
Posts: 13

PostPosted: Mon Nov 13, 2006 5:19 am   
 
UPDATE


the way i actually did it was by adding @headed in to the trigger like this:


TRIGGER {You are now riding across a plain.} {clear;#IF (@Direction) {east 10000;#var headed {east 10000}} {west 10000;#var headed {west 10000}};Direction=%eval(!@Direction)}



it seems to be working..but is there a more simple way of doing it ?
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