• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Too fast execution :P

Status
Not open for further replies.
Level 2
Joined
Aug 26, 2007
Messages
13
Trigger:
Events
Player - Player 1 (Red) types a chat message containing - as An exact match
Conditions
Actions
Set Minus = 1

When i write "-" in the chat the variable Minus is set to 1, as you can see above.

The problem is that i have this trigger:

Trigger:
Events
Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
Conditions
Minus Equal to 1
Actions
Set Minus = 0

Now i would think that AFTER writing "-", the condition of the above trigger should be true, and therefore run the NEXT time that i write something,
but the problem is that when i write "-", BOTH triggers is executed (is that the right word for it ?) and therefore i am not getting a second string/chat message, then my theory would be that the second trigger is being executed AFTER "Minus" has been set to 1, which would result in that both triggers will be executed...

I have had this exact problem before, and last time i just solved it by adding a 0.01 second wait BEFORE setting "Minus" to 1, that worked fine and all, but i think its weird that i have 2 triggers which are NEARLY the same as the above 2, which is working fine WITHOUT any wait before setting the variable.


So my questions is: Is it right that one of the triggers is executing before the other, and therefore running both triggers ? And that the only solution is adding a 0.01 second wait ? (i wouldnt mind, it just seems weird that i, as i said, have identical triggers which IS working.....?

Hope anyone gets this :grin:

Thx in advance.

PS: Dont try to get any meaning out of the triggers (purpose, etc.), i have edited out the unrelevant stuff.
 
Level 6
Joined
Dec 28, 2007
Messages
178
try this:

add line to 1st trigger:
trigger - turn on 2nd trigger
trigger - turn off this trigger

add the same lines to 2nd trigger and set it to be initially off
 
Level 2
Joined
Aug 26, 2007
Messages
13
Nope, still aint working. Executing both triggers when i write "-".

Thx anyways :grin:
 
Level 2
Joined
Aug 26, 2007
Messages
13
Captain Griffen: Isnt that what LightBlood means ? Anyways, HAVE tried it and it still doesnt work without the 0.01 (or more) second wait. Anyone knows what my problem is ? :grin:
 
Player - Player 1 (Red) types a chat message containing <Empty String> as A substring

Every entered text will have an <Empty String> as a Substring that both triggers are executed when typing "-"

if you dont want the secondd trigger to be executed directly with the first when typing "-" you should change the positions of your triggers i think , it should be abovw the other one
 
Level 2
Joined
Aug 26, 2007
Messages
13
Omg, that could easily be whats wrong, i dont have my map at hand right now, so i'll check it out in a couple of days, if that was what you other guys meant, then sorry, i guess i thought i already had tried that out :grin: So thx to all of you, i didnt even know that triggers was executed in at particular order (same event = top trigger first) , now i know :p

I consider this problem solved, since that probably is what's wrong, if not however, i dont think anyone is going to notice 0.01 seconds extra wait 1/4 of the time.

Thx !
 
Status
Not open for further replies.
Top