• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

One Variable for multiple actions

Status
Not open for further replies.
Level 2
Joined
Jun 26, 2012
Messages
7
As the title sais, i was wondering, if one variable could be used with multiple spells, as I always see people talking about "TempX" X=Location/Group/Position or anything like that.

So, for example, i have two heroes, both with a shockwavelike spell, lets call them Fire and Water. And I want to create special effects at the target location.
So instead of tracking the target areas in "Firelocation" and "Waterlocation", I intendet to save both them in "Templocation" and remove them afterwards.
But what will happen if both heroes cast the spell at the same time?
Since this is very unlikely to happen, I just want to get sure, that I have no messed up triggering in my map.

Thanks
Triar
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
The short answer is that Wc3 doesnt run different triggers at the same time and it doesnt swap between the execution of different triggers wich are executed even by the same event.

So if you have 2 triggers reacting to the same event, first one gets executed and when that is done the second one starts. Note that this is different if a trigger uses a Wait (TriggerSleepAction), while one trigger is sleeping Wc3 can start the execution of another trigger.
 
Level 6
Joined
Sep 20, 2012
Messages
179
Interesting, thanks, muzzel. Just one more question: when 2 triggers react on the same event, which one gets executed first? Is it the one which is closer to the cap of the Trigger Editor?
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
This is way more tricky.

Basically with the same event, the trigger which has been created the first in the trigger editor will fire the first, no matter where it's placed in the trigger editor.
Now, if you close the editor, reopen the map, the relative order of triggers will be considered when you will save the map again, this thing can be used for a map "protection", but it's really easy to get rid of it once you understand it.
It's just something lame.

Btw even if the sc2 editor is much more powerfull i hate it because of the poor galaxy support, but i know that the trigger relative order always does matter on save, as it should.
 
Level 6
Joined
Sep 20, 2012
Messages
179
Troll-Brain, interesting. But I do not think it may actually matter in a well-written script. If there are two triggers the order of which is important, it is much safer just to combine then into one complex trigger and add if...then...else to choose which part (or both) to run every time.
 
Status
Not open for further replies.
Top