|
Illogic Beginner
Joined: 11 Nov 2006 Posts: 13
|
Posted: 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 ? |
|
|
|
darkspot Apprentice
Joined: 29 Jul 2002 Posts: 105
|
Posted: 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.
|
|
|
|
Illogic Beginner
Joined: 11 Nov 2006 Posts: 13
|
Posted: Sun Nov 12, 2006 7:08 am |
nope...one trigs id is west,,the others id is east
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
Illogic Beginner
Joined: 11 Nov 2006 Posts: 13
|
Posted: Sun Nov 12, 2006 10:12 pm |
man...thats way more complicated then zmud 5.54...
thanks though |
|
|
|
Illogic Beginner
Joined: 11 Nov 2006 Posts: 13
|
Posted: Sun Nov 12, 2006 11:20 pm |
thanks a lot it worked...but im curious as to how @direction alternates between true and false
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
Illogic Beginner
Joined: 11 Nov 2006 Posts: 13
|
Posted: 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 |
|
|
|
Illogic Beginner
Joined: 11 Nov 2006 Posts: 13
|
Posted: 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
|
|
|
|
Illogic Beginner
Joined: 11 Nov 2006 Posts: 13
|
Posted: 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 ? |
|
|
|
|
|