• 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] Map Initialization race conditions?

Status
Not open for further replies.
Level 2
Joined
Aug 22, 2013
Messages
13
How do I know the order in which the triggers will be executed when they share the same event? For instance:

Trigger A: on map intialization, add all heros on the map to udg_GROUP_HEROS.
Trigger B: on map initialization, add spellbook to all units in udg_GROUP_HEROS

Do the triggers execute in the order that I define them? or is it undefined, meaning that I should put all map initialization actions into the same trigger?
 
Level 2
Joined
Aug 22, 2013
Messages
13
it is defined because it is written when you save the game. display the messages multiple times to see what i mean.

Is there any guarantee in the engine that your triggers of the same event type will execute in some defined order? Your statement is not necessarily related to the question; saving the game has little to do with execution order unless the engine enforces some behavior.
 
Yes, but that doesn't mean that the compiler enforces any particular behavior.

It has to enforce a certain behaviour otherwise triggers that contain functions to be called by other trigger would not always work.

Function calls have to be in the trigger above. Therefore triggers above are most likely written first.
 
Status
Not open for further replies.
Top