Just a basic rundown on how triggers work, every two seconds (or less depending on whether hyper triggers/wait actions/EUD nonsense is involved) the game freezes (for an imperceptibly shot amount of the time for most computers/maps) and executes triggers...
To execute the triggers the game will go through players 1-8 one at a time, for each player it will set current player appropriately then go through the entire list of triggers top-to-bottom... For each trigger the game will check:
Is this trigger owned by currentPlayer? If so, check the conditions, if the conditions pass, run the actions.
Is this trigger owned by the force currentPlayer is in? If so, check the conditions, if the conditions pass, run the actions.
Is this trigger owned by all players? If so, check the conditions, if the conditions pass, run the actions.
(If it was owned by currentPlayer, currentPlayer's force, and the conditions still pass after the first run through, it would run three times in a row)
Then it will proceed to the next trigger in the list.
When all triggers are done for currentPlayer, current player gets incremented, and you go back to the top of the trigger list again.
Once player 8 finishes his last trigger the game unfreezes
I display the amount of times a trigger will run each trigger cycle in CHKD:
Post has been edited 2 time(s), last time on Feb 1 2019, 8:49 pm by jjf28.
TheNitesWhoSay - Clan Aura -
githubReached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.