Cloaking refers to the act of concealing a unit. Cloaked units are generally invisible to players that do not own or share vision with them. The exceptions are cloaked buildings (which are fully visible when seen in fog of war) and units near detectors.
A unit which cloaks is invisible to players which do not have vision of the player who owns it or a detector nearby. Several units have the ability to cloak by default:
- Protoss Observer
- Protoss Dark Templar
- Dark Templar (Hero)
- Zeratul (Dark Templar)
- Tom Kazansky (Wraith)
- Sarah Kerrigan (Ghost)
- Samir Duran (Ghost)
- Alexei Stukov (Ghost)
- Infested Kerrigan
- Infested Duran
- Tom Kazansky (Wraith)
The non-Protoss units cloak via a spell, which drains 18/256 energy per frame (not including energy regeneration). Ghosts in particular have a special per-unit AI which makes them not attack while cloaked. These units are easily cloaked: either create them cloaked (using the Create Unit with Properties trigger action), or attack them with the ability researched (and make sure they have infinite energy).
Protoss Arbiters have the ability to cloak any unit under their field, with the exception of themselves and other Arbiters. There are probably extended units which also have this ability, but as of the time of this writing, no such units are known.
Burrowed Zerg units are also technically cloaked, but they are immobile while burrowed. Any Zerg unit that is able to burrow can be cloaked manually or via triggers by unburrowing as soon as the unit enters an Arbiter's cloaking field. To cloak via triggers, create an Arbiter over a burrowed unit and Order the burrowed unit to move to any location (usually the one you used to create the Arbiter). This method of cloaking will only work until the unit unburrows again. A cloaked Drone uncloaks when it starts morphing into a building, even if the building is canceled and the Drone recovered.
StarCraft's "Set Doodad State" trigger action allows mapmakers to enable or disable doodad units, like the Installation tileset's doors and floor traps. Enabling and disabling such units initiates unique behaviors, like the opening of doors and the deactivation of traps.
Third-party map editors, such as SCMDraft 2, allow mapmakers to use this trigger action to enable and disable non-doodad units. The effects of disabling a non-doodad unit tend to vary depending on what unit is used, but the most common results are the unit becoming cloaked or the game crashing.
A full list of units that can be cloaked without (consistently) crashing can be found in the Set Doodad State article.
Cloaked buildings may not appear to be cloaked at first. If a disabled building looks normal but cannot be selected in-game, then it needs to be detected and then un-detected to be fully cloaked. There are at least three ways to do this.
- Create a Detector unit for the human player, and then remove it.
- Give the cloaked building to the human player, and then give it back to the computer player.
- Turn on shared vision between the human player and the building's owner, and then turn shared vision back off.
Note that in addition to being detected and un-detected, Protoss buildings must also be powered by a Pylon or enabled before they can cloak.
The triggers listed below show the specific actions for each of the three methods. The triggers should run for the players that the building should appear cloaked to. The conditions can be whatever the mapmaker desires.
Example: Cloaked Beacons
Terran Bunkers can be cloaked using any of the three methods described above. However, mapmakers that plan on using cloaked Bunkers should be aware of their quirks:
- Disabled Bunkers cannot load or unload units.
- Units in a disabled Bunker can still attack.
- Disabled Bunkers block ground movement, just like other cloaked buildings.
- If a disabled Bunker is destroyed, the units that were inside will be lost.
There is also a trick for creating Invisible Bunkers that can be walked and built over.
Burning Cloaked Buildings
A building's fire animation shows even when the building is cloaked/disabled. This is a useful visual effect that can be implemented using Terran or Protoss buildings (depending on the desired fire color).
A burning cloaked Bunker:
A burning cloaked Photon Cannon: