SCRMaps
/
Sign in

Renaming units to make counters

This is how you create variables, and it is a job only you can do.

3 min read

In the next module you will use death counters as variables. This is where you prepare them: pick unit types the map never uses and rename them to something you will recognise.

  1. 1Open the unit name editor in ScmDraft.
  2. 2Choose unit types that will never appear on the map.
  3. 3Rename them to something that says what they are for - Level, Exp, Gold, SpawnTimer.
  4. 4Place none of them on the map.

Which units you pick matters more in practice than it sounds. Some candidates are safe and some are not.

안전한 후보Safe: campaign hero units, units from a race you are not using, special buildings - anything that will never appear in this map.
위험한 후보Risky: anything you might place even as decoration, and anything created or destroyed as a side effect of another unit dying.
절대 피할 것Never: units the player actually uses, and units you spawn as mobs.

The names appear verbatim in your triggers and EPScript, so they have to be readable. Once there are many, grouping them with a prefix keeps them manageable.

Naming
Level, Gold, ExpPer-player values - short and unambiguous.
SpawnTimer, WaveTimerTimers named for what they time.
SkillCD, SkillDurationSharing a prefix within one feature makes them easy to find.

If a unit you are using as a counter actually dies in game, the value climbs on its own and the variable is corrupt. The failure is silent - no error, just a value drifting - which makes it one of the hardest bugs to trace.

Once set, never change a unit name. Triggers and EPScript reference them by name, so one changed character stops the map compiling.

Sign in to track your progress