Trigger
Players
Conditions
Actions
Code
Trigger("All players"){
Conditions:
Deaths("All players", "Cave", Exactly, 0);
Actions:
Set Deaths("Current Player", "Cave", Set To, 1);
Wait(0);
Set Deaths("Current Player", "Cave", Set To, 0);
Wait(0);
Preserve Trigger();
}
//-----------------------------------------------------------------//
Conditions:
Deaths("All players", "Cave", Exactly, 0);
Actions:
Set Deaths("Current Player", "Cave", Set To, 1);
Wait(0);
Set Deaths("Current Player", "Cave", Set To, 0);
Wait(0);
Preserve Trigger();
}
//-----------------------------------------------------------------//
Any other unused unit may also be substituted for Cave.
Advantages
This trigger is compact and has several advantages over previous versions. For this reason it is the most robust version of hyper triggering, and should be used instead of other versions. It doesn't have a Next Ending Occurrence (NEO) and experiences wait throttling instead of wait blocking. It can also run with any number of players, without worrying about who "owns" the trigger: it is owned by everyone.
Wait Throttling
Traditionally, running a wait while using hyper triggers would stall the wait indefinitely until the NEO. This phenomenon is known as wait blocking, and means that waits cannot be used.
Triggers that come before the hyper trigger throttle the player's contributions to hyper cycles (e.g., if there are only two players contributing to the hyper cycles and one of them has a 500ms wait above the hyper trigger, there will be a burst of 3 hyper cycles every 500ms). This can be avoided by having at least two players who are not running a wait at any given time.
Triggers that come after the hyper trigger throttle the player's wait times by adding an extra cycle for every two normal cycles the wait would take to complete (e.g., if there are only two players contributing to the hyper cycles and one of them has a 500ms wait below the hyper trigger, that wait would take approximately 750ms). This can be avoided by placing the hyper trigger at the bottom of the trigger list.
For these reasons, it's best to avoid the use of waits and always place the hyper trigger at the bottom of the trigger list.
Further reading: http://www.staredit.net/starcraft/Hyper_Triggers
Post has been edited 11 time(s), last time on Sep 9 2016, 11:05 pm by Sacrieur.
None.