If you've played the Starcraft missions you may have noticed a timer that pops up in a few them. This is called the
countdown timer and has its own special conditions and actions. It appears as a timer on the screen and counts down game seconds (can't be changed to count up).
Countdown Timer (Condition)-Returns true (a bit of programmer jargon to mean the computer reports the condition as true) when the countdown timer is
quantitymod (at least, at most, exactly)
quantitynum (any number). For example, "Countdown timer is at most 10 seconds," would return true as soon as the timer hit 10 seconds, but also if the timer is set to any value below 10 seconds.
Set Countdown Timer (Action)-Modifies the countdown timer with
modifier duration seconds. This allows you to add, set, or subtract from the countdown timer. For example, "Modify countdown timer: set to 10 seconds," would change the countdown timer to be at 10 seconds.
Pause Timer (Action)-Pauses the countdown timer so that it won't count down. The numbers will still be stored on the screen though.
Unpause Timer (Action)-Causes a paused countdown timer to continue counting down. Won't do anything to the timer if it isn't paused.
You should be able to see right away how these can help you extensively, and give you everything that you want. It's a nice built-in function that displays itself professionally, not in choppy display text that can fowl up player messaging.
However, there is one problem: the countdown timer is universal. This is to say that modifying the countdown timer for one player will modify the countdown timer for everyone, there aren't any individual timers. Now, if your map was single-player, then that would be okay, but if it's not so it's definitely an issue. If we just stuck in normally when one player loses the rest of them would also lose, and we couldn't have two players losing at the same time.
With some more sophisticated techniques, we can remedy this problem. The method is called EUDs (or Extended Unit Deaths), and are a way of reading game memory straight from the RAM. Some of the memory Starcraft stores in the RAM is local; that is, it is stored only on your computer and other people playing the game won't have it in their RAM. The other memory is shared, meaning all people playing the game have the same information in their RAM.
If you don't understand it, don't worry, just know local memory is stuff just for you and shared is stuff that's for everyone. Like a marine on the screen is on the screen in the same place for everyone, and if one player moves the marine, it moves for all the players. That marine is stored for everyone. Just suppose, for a moment, that you were able to move the marine on one computer, but not the others. What would happen?
The answer is what we call a desync (desynchronization). To remedy the problem Starcraft will cut your connection with the other computers because the shared memory doesn't match. Now what we're going to do is very simple to implement, but it's a bit harder to explain and may seem a bit crazy.
We're going to set it up so that the countdown timer isn't the same for everyone -- we're changing what should be a shared address. This won't result in a desync until we do something with it though. So as long as it just displays and we don't base any other actions that could affect other computers, Starcraft won't cut the connection.
The end result is that everyone has individual countdown timers. Now when that timer hits zero and you run a defeat trigger based on that, that person is going to have their connection cut (but that's okay).
Here are your triggers:
None specified.
Current Player commands at most 0 [buildings].Memory at Death Table + 331552 is at least 0Memory at Death Table + 331552 is at most 100Current Player has suffered exactly 0 deaths of Vespene GeyserSet countdown timer: set to 60 seconds.Modify death counts for Current Player: set to 1 for Vespene Geyser.Preserve trigger.None specified.
Current player commands at most 0 buildings.Current Player suffers exactly 1 death of Vespene Geyser.Set deaths for Current Player: set to 2 for Vespene Geyser.Unpause timer.Preserve trigger.None specified.
Current Player has suffered exactly 1 deaths of Vespene GeyserPause timer.Preserve trigger.None specified.
Current Player has suffered at least 1 deaths of Vespene GeyserSet deaths for Current Player: set to 1 for Vespene Geyser.Preserve trigger.You should be able to handle the rest. When the countdown timer hits zero, give them a game over.
---
For everyone else: I used digital volume (range 0 - 100) to cause desync. Should work, yeah?
None.