HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Does TriggerExecute waits for the trigger to end before executing the next instructio

07-26-2006, 07:33 PM#1
grupoapunte
hello, i been wondering about this since i started making maps 1 year ago, i never had to use it before but now i should.
Ok the question is, i have a realy long inicialization trigger, and now i want to add even more, so if i make short init with a few TriggerExecute() but i need to keep the order so i was wondering if when a trigger runs it waits for it to finish before runing the next instruction?
07-26-2006, 08:00 PM#2
The)TideHunter(
No, TriggerExecute runs in a new thread (so im told). So its like its a different trigger, but the same 1. All waits and things wont effect the trigger its in because its a new thread.
So to answer your question, it dosent wait.

(If im wrong about the opening in a new thread thing, im sorry, thats just what i'v been told).
07-26-2006, 08:45 PM#3
shadow1500
say you have:
Collapse JASS:
call TriggerExecute(gg_trg_A)
call TriggerExecute(gg_trg_B)
if both triggers have no waits, then trigger A will execute completly, and then trigger B will execute. If you do have waits, then the waits could cause some code of trigger B to execute while trigger A is on the wait etc so dont use waits in those triggers.
07-26-2006, 08:47 PM#4
grupoapunte
I made a test, is not realy like you say it is, it depends on how long a trigger lasts, for example if you have a trigger that make a lot of things and another that only shows a text and you execute the longer first (in my test a loop from 0 to 100000) you will see the text first, well in fact it depends on your system, if you have a multithreading system (every system is like that but suppose you have a dual core where you can actualy make 2 things at the exact same time) the processor will make the diference.

So the anwser was no, so it means i will have to chose:

1) have a ugly long trigger
2) make horrible waits betwen the execution, to ensure bug free