I don't really understand this error. Am I only getting this because the event TriggerAddEventDialogControl requires a fast runtime? If so, my code really should be fine, because it just stops the buttonClicked trigger.
Or is it just that any trigger cannot exceed an execution time of .25s?
Do I need to create another trigger, and run that?
Execution took too long usually means theres a while loop somewhere that is running infinitely. If you have any while loops, start looking there and see if they have conditions that are never satisfied.
it can just be any loop that takes too long
for example if you have a pick each unit in unit group and the unit group being all units in Entire Map
it will take 0-10 seconds and the game will completely halt until the loop has finished. (it will actually kill the trigger first. giving you the error you're asking about)
just add Wait 0.0625 in loops such as these.
for example if you have a pick each unit in unit group and the unit group being all units in Entire Map
it will take 0-10 seconds and the game will completely halt until the loop has finished.
That is not nearly enough to lag the game, even if you have a couple hundred units, unless you are doing extremely heavy processing on each unit in the loop... which means you have something severely wrong with your code design.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm getting the "execution took too long error" when I try to run a function from a trigger with the event:
I'm trying to correct this error with this:
<<code>>
TriggerStop(buttonClicked);createMap(true);<</code>>
I don't really understand this error. Am I only getting this because the event TriggerAddEventDialogControl requires a fast runtime? If so, my code really should be fine, because it just stops the buttonClicked trigger.
Or is it just that any trigger cannot exceed an execution time of .25s?
Do I need to create another trigger, and run that?
Execution took too long usually means theres a while loop somewhere that is running infinitely. If you have any while loops, start looking there and see if they have conditions that are never satisfied.
That is not nearly enough to lag the game, even if you have a couple hundred units, unless you are doing extremely heavy processing on each unit in the loop... which means you have something severely wrong with your code design.