Staredit Network

Staredit Network -> UMS Assistance -> Order of trigger execution
Report, edit, etc...Posted by Azu on 2006-09-16 at 10:10:07
Part of my map is not working right because the triggers are all firing in the wrong order..

The way it should work is

If player 1 has unit a then center location a on unit a.

If player 1 doesn't have unit a, center location a on unit b.

If there is less then 2 units at location a, create a unit at location a.

If there is more then 1 units at location a, create a unit at location b.


4 different triggers in this example.

The problem is, rather then firing this way for each of the 8 players (they are all in force 1 and the triggers are set to force 1), it fires totally differently.

Instead of it working right, in the order I put it in, it does each function 8 times, and then moves on the next, when it obviously should do the functions in the right order, and then go on to the next player at the beginning.

Please tell me how I can fix this! confused.gif
Report, edit, etc...Posted by DT_Battlekruser on 2006-09-16 at 10:47:53
The only way to ensure that all your triggers spread across 8 players fire in precisely the order of players, then the order of creation, is to remove ALL WAITS from your map. Waits cause Starcraft to re-check the triggers, which will mess up the "standard" order.
Report, edit, etc...Posted by Azu on 2006-09-16 at 10:51:47
So.. I would have to do away with hyper triggers to get them to fire in the right order?

There's no other way? =/
Report, edit, etc...Posted by DT_Battlekruser on 2006-09-17 at 00:29:21
You could put in marker Display Text actions to find out in what order your triggers are firing, and restructure the triggers based on that.

The only way to ensure "default" order is to use no waits whatsoever.
Report, edit, etc...Posted by Zeratul_101 on 2006-09-17 at 01:05:29
thats not true, trigger order is perfect with hypers. its when other waits are used that things begin messing up. this messing up is the result of waits' built-in functions which someone else can explain.

about trigger order:

it goes from player 1(top to bottom) all the way to player 8. the only time order of trigger creation matters is when forces and all players are used.

when these group triggers are created, thay are placed at the bottom(i think) of the respective players' list. they remain there invisible and triggers are created/moved above them.
Report, edit, etc...Posted by Beardo on 2006-09-17 at 01:17:34
Just avoid using 'Force X' and 'All Players' when the trigger order actually matters

There was a post on this a few days ago, I think


Report, edit, etc...Posted by Zeratul_101 on 2006-09-17 at 01:20:25
ya, force and all players are best for non-preserved, non-trigger order triggers(like spawning trigs)

theres been quite a few topics on this already.
Report, edit, etc...Posted by DT_Battlekruser on 2006-09-17 at 11:46:37
QUOTE(Zeratul_101 @ Sep 16 2006, 10:05 PM)
thats not true, trigger order is perfect with hypers.  its when other waits are used that things begin messing up.  this messing up is the result of waits' built-in functions which someone else can explain.

about trigger order:

it goes from player 1(top to bottom) all the way to player 8.  the only time order of trigger creation matters is when forces and all players are used.

when these group triggers are created, thay are placed at the bottom(i think) of the respective players' list.  they remain there invisible and triggers are created/moved above them.
[right][snapback]562209[/snapback][/right]


No that's not true. It will only be true if the hypertriggers execute last. Otherwise, the "default" order will be screwed up since the trigger will start checking themselves again when the first wait action is reached.
Report, edit, etc...Posted by Azu on 2006-09-17 at 12:05:18
Oh okay.

So if instead of making the trigger apply to the force, if I just manually make it apply to each of the players, then the triggers will run from top to bottom like, in the order I make them? For each player? Rather then the first trigger running 8 times, and then the second trigger running 8 times, etc, like they are doing now?
Report, edit, etc...Posted by fritfrat(U) on 2006-09-17 at 12:23:28
Having triggers run for a force is exactly the same as checking each individual player. Blizzard's faq that is listed here as a tutorial states this incorrectly, so it is a reasonable error to make.

The way it works is that it runs p1 triggers, then p2, then p3, etc. It would never run a player 2 trigger before a player 1 trigger, excluding if those triggers in question had waits in them.
Report, edit, etc...Posted by Azu on 2006-09-17 at 21:07:17
Oh..

I have some hyper triggers

And some triggers with waits


And then a have a few triggers (without waits), that I need to run in certain order, one player at a time. So like, if the first of those triggers ran for player 1, then the rest of them would right after, also for player 1, rather then the first trigger running for player 1 and then running for player 2 etc.

Cause the first of these triggers will center a location on a unit for the player, and the second of these triggers will have a condition based on that location, and an action, so it will not work right if they don't run in order. There are others also.

So.. what exactly do I have to do to get them to run in the right order? confused.gif

Is it impossible to do this because some of my triggers do have waits? ( The ones that need to run in order don't have waits but some of my other triggers do =/ )
Next Page (1)