• 🏆 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!

HIVE

MyPad
MyPad
Well, with what I know, triggerconditions are executed on the same thread with the trigger event while triggeractions are executed on a different thread. The proof of this is that it is safe to destroy triggers with triggerconditions but not safe to destroy triggers alone when they have triggeractions. Furthermore, triggeractions allow the usage of the forbidden function:

call TriggerSleepAction(real)
KILLCIDE
KILLCIDE
Hmm not sure how that correlates with the infinite loop issue I had. Would you be able to illustrate it? xD
MyPad
MyPad
I'll take your previous attempt as an example:

Unit enters region.
Event associated with entering of region is fired.

(Technically a new thread)
Trigger registered to the event is triggered.
Trigger conditions are evaluated.

(Another thread)
Trigger actions are executed.
Move unit to other region.
MyPad
MyPad
To further clarify what I mean to convey, think of dealing damage while detecting damage. It causes an infinite loop because before the trigger finishes, another damage instance is detected. This will cause the damage trigger to fire again, leading to the same event wherein you will deal damage again in the damage instance. In that case, the event will keep on firing indefinitely, causing a crash.
KILLCIDE
KILLCIDE
Well I know how infinite loops work, which is why I disabled the trigger while I move the unit. But how does the other thread start if the trigger is disabled?
MyPad
MyPad
That example is quite similar to the one above it. Since moving a unit is synchronous, unlike actually applying the damage, turning the trigger that catches the event when a unit enters a certain region off and moving the unit there and turning it back on will and should not work. (although in my case, it caused another type of infinite loop) It will then evaluate and execute, leading the unit back to where it technically was and so on, and so forth, perhaps until the game crashes or the computer is forced to sign out.

EDIT:

I didn't realise you already replied.
Top