Ever make a map, and the triggers are working perfeclty, then you add a respawn trigger and everything just freezes up? and the waits become 1hour nitemares?Well I have solved the problem... [Syncronized Wait] and [Sliced Wait].
-
What exactly is causing the problem you might ask?
Well in StarCraft, the game activates map triggers by going along within the map from top to bottom throughout the triggers. The triggers are fluidly ran and go on infinitely until the action and condition are met. There are a few triggers, however, cause for the actions from top to bottom from occuring. These triggers "break" the loop from top to bottom. These "breaks" include the actions: [Wait], [Pause Game] and [Center View]. These triggers are what cause the game to stop the loop and have the most priority in actions (meaning, they happen and end before any other triggers occur).
These "breaks" allow for the game to initiate commands without them clashing into each other.
What really causes the main problem is the fact that you can entirely ruin your game by adding a [Hyper Trigger], which is a trigger that causes for the 1300ms pause that naturally occurs, and turns it into a <97ms pause.
So, whats the solution?[Syncronized Wait]It is in essence, a wait that occurs with another wait... sound impossible? Well, the StarCraft engine runs from top to bottom, and checks to see if a trigger is finished. If all triggers are ran with the exact same wait; it results in them becoming sync; meaning they start to not stack, but run with each other (it makes it seem as though its not stacking).
How exactly do you make this happen?Simple, just make every wait within your triggers a set amount.
For example, setting your waits to exactly 500ms.
By setting your triggers to exactly 500ms as well as your [Hyper Trigger] to 500ms, you can sync all of your waits together which solves your long waits. The only problem with adding a 500ms synced [Hyper Trigger], is that the hyper trigger tacks on an additional wait time (so in this example, the wait adds 500ms to each trigger).
If you have a respawn that occurs after 5000ms, but are using the 500ms example, just put within the trigger something called a [Sliced Wait].
[Sliced Wait]What is a sliced wait?A sliced wait is basicly what it is, a wait that is broken up into separate parts, but still containing the exact time occuring each time.
For example, above I stated that I wanted to add a 5000ms wait within a 500ms [Syncronized Wait].
To slice it, you take the 5000ms/500ms. resulting in 10x.
This 10x would mean that the wait in the trigger has to have 10 of them. so the resulting trigger would look like this:
CONDITION:
Commands 0 Marine
ACTION:
Create 1 Marine
Wait 500ms.
Wait 500ms.
Wait 500ms.
Wait 500ms.
Wait 500ms.
Wait 500ms.
Wait 500ms.
Wait 500ms.
Wait 500ms.
Wait 500ms.
Preserve trigger.
and because the [Hyper Trigger] is sync'ed by 500ms, you divide the amount of triggers by 1/2, resulting in:
CONDITION:
Commands 0 Marine
ACTION:
Create 1 Marine
Wait 500ms.
Wait 500ms.
Wait 500ms.
Wait 500ms.
Wait 500ms.
Preserve trigger.
By having this trigger, it slices your triggers wait times and allows for the trigger to [Sync Wait] and occur smoothly, without the need to use death counters.
Of course, you don't need to Sync your [Hyper Trigger], if you don't sync your hyper trigger, you may place the [Hyper Trigger] on the way bottom of the list.
By having both these concepts into action within your map, you will no longer have the "forever center screen", "everlasting wait", and "the wait disaster" that you all have experienced at least once in your mapping life.
As a normal side effect, your amounts of trigger actions will decrease greatly due to the multiplied waits that are required.
But, this will allow for you to use infinite amounts of waits for a single player without resorting to deathcounts.
Hopefully this solves your problems.
(btw, this is how I did that whole craziness in my bounds, where the 'unit colors are flashing', 'music is going', and 'leaderboard is changing'.)
(Im still testing on effectiveness and the limits of this concept.)
And remember, Red2Blue taught you this...