🏆 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!
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:
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.
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?
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
call TriggerSleepAction(real)