Trigger order
Jul 15 2008, 11:39 pm
By: M s4  

Jul 15 2008, 11:39 pm M s4 Post #1



I'm working on a system that requires refreshing of triggers.

Trigger (Player 1):
Conditions:
Player 1 has suffered exactly 1 death of Zerg Hatchery.
Actions:
Create 1 Zerg Zergling for Player 1 at Location 1.

Trigger (Player 1):
Conditions:
Player 1 has suffered exactly 2 death of Zerg Hatchery.
Actions:
Create 1 Zerg Hydralisk for Player 1 at Location 1.

Trigger (Player 1):
Conditions:
Player 1 brings at least 1 Terran Civilian to Location 2.
Actions:
Set deaths, Player 1, Zerg Hatchery, exactly, 1
Wait (0)
Set deaths, Player 1, Zerg Hatchery, exactly, 2
Wait (0)

I don't know how adding triggers for multiple players effect the ordering though. Btw, this is a noob question, but how do triggers belong to "Foes" or "Allies" work?



None.

Jul 16 2008, 12:12 am stickynote Post #2



By adding triggers for multiple players, do you mean adding the effect for each player in the same trigger, or making an entirely new trigger for each player with the same conditions and actions? As for the last question, the trigger applies to the allies and foes of the current player.



None.

Jul 16 2008, 12:52 am rockz Post #3

ᴄʜᴇᴇsᴇ ɪᴛ!

Player 1 runs first, then player 2, then player 3, etc.

"all players" is just player 1, player 2, player 3, etc...

Force 1 works the same way.

Foes/Allies doesn't work (there are no foes/allies players). (correct me if I'm wrong)

Neutral Players are player 1-8 which are set to neutral.

The trigger set you just put up will wait 84 ms, make a ling, wait 84 ms, make a hydra, once you have 1 death of a hatchery. Remember to make good use of "current player".



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jul 16 2008, 1:07 am Falkoner Post #4



Quote
The trigger set you just put up will wait 84 ms, make a ling, wait 84 ms, make a hydra, once you have 1 death of a hatchery. Remember to make good use of "current player".

Not 84 ms, 42.

Other than that, I think the rest is all correct.



None.

Jul 16 2008, 1:10 am Roy Post #5

An artist's depiction of an Extended Unit Death

Uh, if you're waiting 0 milleseconds, then when you bring the civilian to location 2, only the hydra will be made because the trigger runs all the way through before the other triggers check their conditions again (or so I think).

Well... You haven't told us why you posted those triggers :P Was the trigger order the only question?

And the Foes/Allies doesn't work if you try to set a trigger for them (You were right :P) I believe triggers can only be owned by Players 1-8, Forces, and All Players.
The others (Players 9-12, Unused, Foes/Allies/Neutral) cannot own triggers. They CAN be used in conditions/actions, though (Except maybe the Unused...).

Oh, and speaking of the 42ms and 84ms, I was looking at it, and it seems that 42ms is the fastest wait if there are no other triggers with waits running (despite the owner of the player; don't give me that wait block crap :P) However, all waits below 84ms seem to synchronize if they run at the same time. I could be wrong, but this is what it looked like when I tested it.




Jul 16 2008, 1:25 am M s4 Post #6



Let's say you make 4 trigs for P1, 4 trigs for P2, and 4 trigs for P3. And then you make an All Players trig. In which sequential position in the grand scheme of things does this trigger go?



None.

Jul 16 2008, 1:28 am Falkoner Post #7



Triggers always go in the order you create, them, so it would in your case go trigs for P1, 4 trigs for P2, and 4 trigs for P3 and then the all players trigger, if I did the all players trigger first, it would run first, the order of them running all depends on when you create them, or where you move them. You can shift click players to see the trigger order in SCM Draft's classic trigedit.



None.

Jul 16 2008, 1:37 am Zombiechao Post #8



Quote
And the Foes/Allies doesn't work if you try to set a trigger for them
This is news to me. Does it work for computers though?



None.

Jul 16 2008, 1:50 am Falkoner Post #9



No, like if you try to give them a trigger, like put it under that name, it doesn't work at all.

Quote
Oh, and speaking of the 42ms and 84ms, I was looking at it, and it seems that 42ms is the fastest wait if there are no other triggers with waits running

Yes, 42 is the fastest wait time you can have, and any time you enter is rounded up to the nearest multiple of 42. so if you enter 67, you get an 84 millisecond wait.



None.

Jul 16 2008, 1:58 am M s4 Post #10



Quote from Falkoner
Triggers always go in the order you create, them, so it would in your case go trigs for P1, 4 trigs for P2, and 4 trigs for P3 and then the all players trigger, if I did the all players trigger first, it would run first, the order of them running all depends on when you create them, or where you move them. You can shift click players to see the trigger order in SCM Draft's classic trigedit.

I may be missing something, but that seems to contradict the fact that P1's triggers will always run before P2's.

So lets say in Classic TrigEdit this is what I have:

Trigger1 (P2)
Trigger2 (P1)
Trigger3 (P3)
Trigger4 (All Players)
Trigger5 (P2)

In which order would they fire? If what the information I'm looking is ambiguous, let me know. Thanks for all the tips so far.



None.

Jul 16 2008, 2:02 am Falkoner Post #11



It would fire in that exact order:

Trigger1 (P2)
Trigger2 (P1)
Trigger3 (P3)
Trigger4 (All Players)
Trigger5 (P2)

Now, waits may throw it off somehow, but with no outside variables, it would just run top to bottom.



None.

Jul 16 2008, 2:16 am M s4 Post #12



OK Thanks Falkoner. I'm guessing the P1 runs first and P2 runs second is just the way the Click-based triggering with all its fancy Player menus translates triggers to syntax-based triggering.



None.

Jul 16 2008, 3:07 am rockz Post #13

ᴄʜᴇᴇsᴇ ɪᴛ!

Hyper triggers run at 84 ms, right? There's a wait 0, end triggers, create unit, wait 0, end triggers, create unit. That's the same as hyper triggers, I thought.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jul 16 2008, 3:24 am Falkoner Post #14



Yes, they do run at 84 ms, the wait gets doubled, I'm too tired to explain why right now though :(



None.

Jul 16 2008, 10:50 am NudeRaider Post #15

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from Falkoner
It would fire in that exact order:

Trigger1 (P2)
Trigger2 (P1)
Trigger3 (P3)
Trigger4 (All Players)
Trigger5 (P2)

Now, waits may throw it off somehow, but with no outside variables, it would just run top to bottom.
No.
Triggers fire player by player, lower player numbers first. THEN trigger order is considerd.
If you select forces or all players starcraft makes copies of them and runs them for each player of that group.
Order would be:
Trigger2 (P1)
Trigger4 (All Players, Copy for P1)
Trigger1 (P2)
Trigger4 (All Players, Copy for P2)
Trigger5 (P2)
Trigger3 (P3)
Trigger4 (All Players, Copy for P3)

Here's an old topic with more information about trigger firing order.




Jul 16 2008, 3:03 pm Falkoner Post #16



Okay, yeah, I forgot about that, I never use forces when I trigger, so it does go in exact trigger order. So yeah, if you want it to go exactly as you place the triggers, never place it under All Players or Forces.

Also, I decided to make a map showing exactly what fritfrat showed, here it is:
[attach=1370]

I'm not sure if it works, can't test here, but I think it should.

Attachments:
Creation Test.scm
Hits: 0 Size: 51.58kb



None.

Jul 16 2008, 4:50 pm rockz Post #17

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from Falkoner
Yes, they do run at 84 ms, the wait gets doubled, I'm too tired to explain why right now though :(
I slept on it. The wait gets doubled due to two wait (0)s acting at the same time.

Also, they always go from player 1 to player 8, no matter what, so even if you have all of player 8's triggers first, his will still execute last.

Post has been edited 1 time(s), last time on Jul 16 2008, 5:13 pm by rockz.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jul 16 2008, 10:19 pm Falkoner Post #18



Wow, I am truly retarded, this topic completely changes my thoughts on how trigger order works, I guess I've never had systems that require me to have the order correct across multiple players, sorry about the bad information I gave earlier :(



None.

Jul 17 2008, 1:37 pm NudeRaider Post #19

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

I am surprised. You were contributing to the old topic of mine about trigger order. I would have expected you noted the result.
Yeah whatever, but dont worry, nobody is perfect. ;) We all have posted wrong information once in a while.

Btw. thats why you only need 1 location in systems cycling through players that use multiple triggers without having to care about order.




Jul 17 2008, 3:11 pm Falkoner Post #20



Quote
Btw. thats why you only need 1 location in systems cycling through players that use multiple triggers without having to care about order.

Yeah, I always just put them in an order that wouldn't cause problems when I came across things like that :P



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:47 pm]
Ultraviolet -- Yeah, I suppose there's something to that
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
[2024-5-05. : 9:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[2024-5-05. : 9:35 pm]
Vrael -- that is insane
[2024-5-05. : 9:35 pm]
Vrael -- damn is that all EUD effects?
[2024-5-04. : 10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
Please log in to shout.


Members Online: Roy, Rawflesh0615