Everything happens sequentially (ordered). So similar to how Actions execute from top to bottom, triggers will be ordered as well. But there's an important exception to this rule that I discuss below.
First, an example of a trigger that relies on the order of the Actions to work properly:
-
this works
-

Events
-


Unit - A unit Starts the effect of an ability
-

Conditions
-

Actions
-


Set Variable Point = (Center of SomeRegion <gen>)
-


Special Effect - Create a special effect at Point using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
That same trigger but with the Actions ordered incorrectly.
-
this doesnt work
-

Events
-


Unit - A unit Starts the effect of an ability
-

Conditions
-

Actions
-


Special Effect - Create a special effect at Point using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
-


Set Variable Point = (Center of SomeRegion <gen>)
The special effect is created at Point before Point is even Set, so it doesn't know where to create the effect.
I'm sure you were aware of this already, but I figured I'd break it all down.
What's more important to mention is the situations where this DOESN'T work perfectly. You need to be careful of situations where you cause the Actions of one trigger to be added onto your current trigger. This can happen when the Actions of your trigger cause the Event of another trigger to go off. Here's an example:
This trigger makes the casting unit deal
lethal damage to the target unit and then displays the name of the casting unit. Nothing wrong here, right? Not yet at least, but what would happen if that UnitVariable was used in a trigger with the
Unit - A unit Dies event?
-
issue 1
-

Events
-


Unit - A unit Starts the effect of an ability
-

Conditions
-


(Ability being cast) Equal to Storm Bolt
-

Actions
-


Set Variable UnitVariable = (Casting unit)
-


Unit - Cause UnitVariable to damage (Target unit of ability being cast), dealing 999999.00 damage of attack type Spells and damage type Normal
-


Game - Display to (All players) for 30.00 seconds the text: (Name of UnitVariable)
Our
Cause Damage action kills the (Target unit of ability being cast) which causes the
Unit - A unit Dies event to go off, which causes our next trigger to run:
-
issue 2
-

Events
-

Conditions
-

Actions
-


Set Variable UnitVariable = (Dying unit)
-


Game - Display to (All players) for 5.00 seconds the text: (Name of UnitVariable)
Do you see the issue? UnitVariable is going to be Set to the Dying unit
IMMEDIATELY after our
Cause Damage action from the first trigger. This is because the unit died during our first trigger. It's in these situations that Global Variables can cause issues.
These are the results:
-
issue 1 and 2 combined
-

Events
-


Unit - A unit Starts the effect of an ability
-

Conditions
-


(Ability being cast) Equal to Storm Bolt
-

Actions
-


Set Variable UnitVariable = (Casting unit)
-


Unit - Cause UnitVariable to damage (Target unit of ability being cast), dealing 999999.00 damage of attack type Spells and damage type Normal
-


Set Variable UnitVariable = (Dying unit)
-


Game - Display to (All players) for 5.00 seconds the text: (Name of UnitVariable)
-


Game - Display to (All players) for 30.00 seconds the text: (Name of UnitVariable)
The Actions of our second trigger are inserted directly into our first trigger, and they're inserted BEFORE the first trigger has finished running.
Since UnitVariable is shared between the two triggers it's value is going to be Set twice, and in this case it's value ends up as the Dying unit.
This results in the displaying of the name of the (Dying unit) twice, while never displaying the name of the (Casting unit) despite wanting to.