Death Counts

Death Counts are the variables of StarCraft. There is an almost endless supply of them and they allow you to perform many advanced map making techniques, a good map almost always has Death Counts and this tutorial will show you how to use them.

Contents

Basic Information
Death Count Timers
Death Count Randomization
Death Count Switches
Death Count Transfers

Basic Information

Each unit for each player in StarCraft has a Death Count, each death count has a different variable for each player. There are about 200 units for each player, including Unused Units, this makes a total of about 1600 units that are usable as Death Counters, although you may want to mainly use Unused Units for Death Counters since they will probably not be killed in your map, and so their Death Count will not get thrown off by being killed. Death Counts can be detected, added to, subracted from, or set to a specific number. This is why they make such great variables to transfer numbers in StarCraft such as minerals, vespane, or even units.

Only players 1-8 can have their Death Counts changed through triggers, players 9-255 cannot have their Death Counts changed using triggers. A Death is added to a unit when it is killed and only to the person who suffered the Death. Death Counts can be used in many ways, as timers, for Randomization, even as data storage. They are extremely useful overall.

Death Count Timers

Death Counts can be used as invisible timers. The problem is just figuring out how often the trigger's conditons are checked. So, if you have Hyper Triggers and you are playing in Fastest, triggers will be checked about 11.8 times per second. If you are on Fastest without Hyper Triggers, they're checked once about every 1.5 seconds. So I'm going to use Hyper Triggers, my first trigger will constantly add a Death Count, you can also subtract a Death Count, but adding works just as well.
Here's how it looks:

Conditions
Always
Actions
Modify death counts for Player 1: Add to 1 for 'Terran Physics Lab'
Preserve Trigger

The next trigger detects when the Deaths hit 118 then it resets the death and does whatever actions I want.
See how it looks below:

Conditions
Player 1 has suffered at least 118 deaths of 'Terran Physics Lab'
Actions
Modify death counts for Player 1: Set to 0 for 'Terran Physics Lab'
Set 'Switch 01'
Preserve Trigger

If you want the timer to repeat, just add a Preserve Trigger. I used 118 deaths, as 11.8 times 10 is 118, so in 10 seconds Switch 01 will be set with this trigger.

The difference between the addition method and the subraction method is that unless you specially make a trigger to set the Death Count high at the beginning of the game, subraction will do the actions immediately, then reset, while additon will not.


Death Count Randomization

Okay, for Randomization you want to make a timer like you saw above, and you add(or subract) a Death Count constantly up(or down) to however many outcomes you want.
Below are the counting triggers for 5 outcomes:

Conditions
Always
Actions
Modify death counts for Player 1: Subtract to 1 for 'Terran Physics Lab'
Preserve Trigger
Conditions
Player 1 has suffered exactly 0 deaths of 'Terran Physics Lab'
Actions
Modify death counts for Player 1: Set to 5 for 'Terran Physics Lab'
Preserve Trigger

Make sure that you're timer triggers are in the proper order, if the order of the above triggers were switched, then the death would stay at zero for a loop, so you would have to reset to four, rather than five for five outcomes.
The next triggers would be the actions of each outcome, based on what number the death countdown is currently on.
Below are an example of some of the outcome triggers:

Conditions
Player 1 has suffered exactly 1 deaths of 'Terran Physics Lab'
Player 1 brings at least 1 'Terran Civilian' to 'Random'
Actions
Display for current player: 'Lucky number is 1!'
Move all 'Terran Civilian' for Player 1 at 'Random' to 'Move Back'
Preserve Trigger
Conditions
Player 1 has suffered exactly 2 deaths of 'Terran Physics Lab'
Player 1 brings at least 1 'Terran Civilian' to 'Random'
Actions
Display for current player: 'Lucky number is 2!'
Move all 'Terran Civilian' for Player 1 at 'Random' to 'Move Back'
Preserve Trigger
Conditions
Player 1 has suffered exactly 3 deaths of 'Terran Physics Lab'
Player 1 brings at least 1 'Terran Civilian' to 'Random'
Actions
Display for current player: 'Lucky number is 3!'
Move all 'Terran Civilian' for Player 1 at 'Random' to 'Move Back'
Preserve Trigger

And so on. If combined with Hyper Triggers, the cycle will go so quickly, that it will be seemingly random. This method only works well when the randomization only happens every once in a while, and if you want it to be different each game, it cannot happen at the same time each game.

Death Count Switches

Death Counts also can be used as an alternative to Switches. Rather than make them set or cleared, you can simply set a Death Count to zero for cleared, or one as set. Death Counts also allow you to have more than two possible settings on a switch, as they can be set to any number you want.
Also, unlike Switches, Death Counts do not require the use of a string, however, if you choose to rename the unit used for the Death, they will take up a string. Being able to add or subract from them also can help depending on what system you are using them as switches for.

Death Count Transfers

In Starcraft, there is no simple way to move numbers from one variable, such as Minerals or Vespane Gas, into another one. However, with Death Counts and Binary Count-Offs, tranferring variables, doing Math with variables, and copying values from one variable to another become possible, and can be done in a single trigger cycle.

Death Counts Test

Return to Top