Trigger reference
Every trigger condition and action: what it does, its arguments, its text form and where it is stored in the map.
Every trigger condition and action in StarCraft and Brood War: what it does in the game, the arguments it takes, how it is written as text, and where each argument is stored in the map file. The game's behaviour described here is StarCraft 1.16.1's, found by running test maps. Much of StarCraft: Remastered's trigger code has been read as well, and the parts a map maker would notice were checked by playing test maps. What it does differently is under In StarCraft: Remastered.
Each condition and action has a number, a line in the text form, and a table of where its arguments are stored. These come from the same tables the editor reads and writes maps with. The text form is SCMDraft 2's TrigEdit syntax, so an example line can be pasted into SCMDraft or into the editor's Text Trigger Editor.
In scmJS, triggers are edited in:
- the Trigger Editor (Triggers ▸ Trigger Editor…, Ctrl+T), a form like StarEdit's;
- the Text Trigger Editor (Ctrl+Shift+T), the same triggers in the text form. It comes with the TrigEdit plugin, which is installed but off until you turn it on in Plugins ▸ Manage Plugins…. Triggers ▸ Import Triggers… and Export Triggers… use the same text without it;
- TrigScript (Triggers ▸ TrigScript…), triggers written as code. Each condition and
action is a function named after it, such as
setDeaths; see the TrigScript guide; - the Mission Briefing Editor (Triggers ▸ Mission Briefing Editor…), for briefings.
The Trigger Map plugin, from Plugins ▸ Browse Plugins…, draws which triggers set and read each switch, death count and location, and lists triggers that can never run. See Triggers in the user guide.
- How triggers runA trigger is a list of up to 16 conditions and up to 64 actions, and the players it runs for.
- ConditionsA condition is a test a trigger makes on every pass, unless the trigger is part way through its actions.
- ActionsAn action is what a trigger does once its conditions hold.
- Mission briefing actionsA mission briefing is the screen before a single-player mission: portraits, text and speech, one briefing per player.
- Players and groupsThe sections from here on are reference tables.
- Argument valuesThese are the values the enumerated arguments take, and the number each is stored as.
- The trigger recordTriggers are stored in the map's TRIG section, one 2400-byte record per trigger, in the order of the list.
- EUDAn *EUD* trigger uses a player or unit value outside the game's tables to reach other parts of the game's memory.
- In the source