scmJS docs

Actions

An action is what a trigger does once its conditions hold. These are all of them:

Action Does
Center View moves the player's screen to a location
Comment nothing in the game; names the trigger in an editor
Create Unit creates units at a location
Create Unit with Properties creates units with hit points, energy and other properties set
Defeat the player loses
Display Text Message shows text on the player's screen
Draw the player draws
Give Units to Player hands units at a location to another player
Kill Unit kills every unit of a type a player owns
Kill Unit At Location kills units in a location
Leader Board Control a leaderboard of units owned
Leader Board Control At Location a leaderboard of units owned in a location
Leader Board Greed a leaderboard of ore and gas towards a goal
Leader Board Kills a leaderboard of kills
Leader Board Points a leaderboard of a score
Leader Board Resources a leaderboard of ore or gas
Leaderboard Computer Players whether computer players are on leaderboards
Leaderboard Goal Control a leaderboard of units owned, towards a goal
Leaderboard Goal Control At Location the same, in a location
Leaderboard Goal Kills a leaderboard of kills, towards a goal
Leaderboard Goal Points a leaderboard of a score, towards a goal
Leaderboard Goal Resources a leaderboard of ore or gas, towards a goal
Minimap Ping pings a location on the player's minimap
Modify Unit Energy sets units' energy to a percentage
Modify Unit Hanger Count adds interceptors or scarabs
Modify Unit Hit Points sets units' hit points to a percentage
Modify Unit Resource Amount sets how much a mineral field or geyser holds
Modify Unit Shield Points sets units' shields to a percentage
Move Location centres a location on a unit
Move Unit moves units from one location to another instantly
Mute Unit Speech silences unit voices
Order orders units to move, patrol or attack
Pause Game pauses the game, in single player
Pause Timer stops the countdown timer
Play WAV plays a sound
Preserve Trigger keeps the trigger so it can run again
Remove Unit removes every unit of a type a player owns
Remove Unit At Location removes units in a location
Run AI Script starts a computer player's AI script
Run AI Script At Location starts an AI script that uses a location
Set Alliance Status makes the player an enemy or ally of another
Set Countdown Timer sets the countdown timer
Set Deaths changes a death count
Set Doodad State turns doors and traps on or off
Set Invincibility makes units invincible, or not
Set Mission Objectives sets the text of the objectives screen
Set Next Scenario chooses the map that follows a win
Set Resources changes a player's ore or gas
Set Score changes a player's score
Set Switch sets, clears, toggles or randomizes a switch
Talking Portrait shows a unit's portrait talking
Transmission a message with a portrait, a sound and a minimap ping
Unmute Unit Speech lets unit voices play again
Unpause Game resumes a game Pause Game stopped
Unpause Timer restarts the countdown timer
Victory the player wins
Wait holds the rest of the trigger for a time
Disable Debug Mode stops the Esc key from skipping the trigger
Enable Debug Mode lets the Esc key skip the trigger again

Actions are carried out in order, for the player the trigger is running for. Actions that act on "the player" — showing text, moving the screen, winning — act on that player.

Center View#

Moves the player's screen so the location is in the middle of it. In a single-player game the screen scrolls there and the trigger is held, like a Wait, until it arrives; in a multiplayer game it jumps at once. It does nothing for a computer player, while the game is paused, or with no location.

Action 10 · Center View(Location);

Argument Takes Stored in the action
Location a location (Anywhere is location 64) bytes 0–3
Center View("Base");

Comment#

Does nothing in the game. Editors show the text as the trigger's name in the trigger list, which is what it is for.

Action 47 · Comment(Text);

Argument Takes Stored in the action
Text text, stored as a string-table entry bytes 4–7
Comment("Wave 3 spawns");

Create Unit#

Creates the number of units of the type for the player, at the middle of the location. A unit that does not fit there is placed at the nearest spot it fits, up to 128 pixels away; a unit with no room that close is not created. A building is not moved: it is not created on ground it cannot stand on, or where something is in the way. Mineral fields and geysers are always created for Player 12. A count of 0 creates one unit, although the text form writes it as All.

Not every unit can be created:

The scmJS Trigger Editor's unit list for Create Unit shows only the types that can be created, once the game data is installed.

The action has a properties field, bytes 20–23, like Create Unit with Properties. The game reads it for Create Unit too: a value from 1 to 64 creates the units with that properties slot. Editors write 0 there.

Action 44 · Create Unit(Player, Unit, Count, Location);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type a trigger can make; the unit classes make nothing bytes 24–25
Count a number of units, 1 to 255 (0 makes one) byte 27
Location a location (Anywhere is location 64) bytes 0–3
Create Unit("Player 8", "Zerg Zergling", 6, "Spawn");

Create Unit with Properties#

As Create Unit, and the new units take the properties of one of the map's 64 unit properties slots: hit points, shields and energy as percentages, resources, hangar count, and states such as cloaked, burrowed, lifted or hallucinated. The slots are stored in the map's UPRP section; the editor's Triggers ▸ Unit Properties Slots… edits them. A unit is created cloaked or burrowed only if its owner has the technology that lets it, and resources are kept to 16 bits. It can create the same units, for the same players, as Create Unit.

Action 11 · Create Unit with Properties(Player, Unit, Count, Location, Properties);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type a trigger can make; the unit classes make nothing bytes 24–25
Count a number of units, 1 to 255 (0 makes one) byte 27
Location a location (Anywhere is location 64) bytes 0–3
Properties a unit properties slot bytes 20–23
Create Unit with Properties("Player 8", "Zerg Hydralisk", 4, "Spawn", 1);

Defeat#

The player loses. Nobody else is affected. In a Use Map Settings game the player's units stay on the map, idle, and the player stops running triggers and drops out of every group. A Defeat that comes after a Victory for the same player in the same pass waits, and so never takes effect. See Winning and losing.

Action 2 · Defeat();

It takes no arguments.

Defeat();

Display Text Message#

Shows the text on the player's screen. Always Display shows it even to a player who has turned subtitles off; Don't Always Display follows that setting. The text can carry the game's colour codes. Only the player the trigger runs for sees it: a computer player's Display Text shows on nobody's screen. The text stays for 4 seconds, or 50 milliseconds for each character of a longer text, in real time.

Action 9 · Display Text Message(Display, Text);

Argument Takes Stored in the action
Display Always Display or Don't Always Display bit 0x04 of byte 28
Text text, stored as a string-table entry bytes 4–7
Display Text Message(Always Display, "Defend the base until help arrives.");

Draw#

Gives the player a draw. It is a draw for everyone only when every player in the game draws or wins in the same pass; otherwise every other player still in the game with no result is defeated. See Winning and losing.

Action 56 · Draw();

It takes no arguments.

Draw();

Give Units to Player#

Hands the number of units of the type in the location from one player to another. With a group as the player, the count is for the whole group. A transport takes its cargo along to the new owner; a unit inside a transport is not given on its own.

Action 48 · Give Units to Player(From, To, Unit, Count, Location);

Argument Takes Stored in the action
From a player or group bytes 16–19
To a player or group bytes 20–23
Unit a unit type, or one of the unit classes bytes 24–25
Count a number of units, 1 to 255, or All (stored as 0) byte 27
Location a location (Anywhere is location 64) bytes 0–3
Give Units to Player("Player 12", "Current Player", "Any unit", All, "Rescue");

Kill Unit#

Kills every unit of the type the player owns, anywhere on the map, with their death animation. A unit killed this way adds nothing to anyone's death count, kills or score: only a unit that dies in the game, shot or killed by a spell, does. A death counter meant to see a unit die therefore never sees Kill Unit. Any unit means every unit the player owns, mineral fields included.

Action 22 · Kill Unit(Player, Unit);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Kill Unit("Player 8", "Zerg Larva");

Kill Unit At Location#

As Kill Unit, for the number of units of the type in the location, units loaded in transports there included. With a group as the player, the count is for each player in it.

Action 23 · Kill Unit At Location(Player, Unit, Count, Location);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Count a number of units, 1 to 255, or All (stored as 0) byte 27
Location a location (Anywhere is location 64) bytes 0–3
Kill Unit At Location("All Players", "Men", All, "Lava");

Leader Board Control#

Shows a leaderboard of how many units of the type each player owns. A map shows one leaderboard at a time: showing another replaces it. It is one leaderboard for everyone, whichever player's trigger shows it, and the last one shown wins.

Action 17 · Leader Board Control(Label, Unit);

Argument Takes Stored in the action
Label text, stored as a string-table entry bytes 4–7
Unit a unit type, or one of the unit classes bytes 24–25
Leader Board Control("Marines", "Terran Marine");

Leader Board Control At Location#

A leaderboard of how many units of the type each player has in the location.

Action 18 · Leader Board Control At Location(Label, Unit, Location);

Argument Takes Stored in the action
Label text, stored as a string-table entry bytes 4–7
Unit a unit type, or one of the unit classes bytes 24–25
Location a location (Anywhere is location 64) bytes 0–3
Leader Board Control At Location("On the hill", "Men", "Hill");

Leader Board Greed#

A leaderboard of each player's ore and gas together, towards the goal.

Action 40 · Leader Board Greed(Goal);

Argument Takes Stored in the action
Goal a whole number, 0 to 4,294,967,295 bytes 20–23
Leader Board Greed(5000);

Leader Board Kills#

A leaderboard of how many units of the type each player has killed.

Action 20 · Leader Board Kills(Label, Unit);

Argument Takes Stored in the action
Label text, stored as a string-table entry bytes 4–7
Unit a unit type, or one of the unit classes bytes 24–25
Leader Board Kills("Kills", "Men");

Leader Board Points#

A leaderboard of each player's score of the kind. With Custom, the numbers are whatever Set Score has made them.

Action 21 · Leader Board Points(Label, Score);

Argument Takes Stored in the action
Label text, stored as a string-table entry bytes 4–7
Score a score type bytes 24–25
Leader Board Points("Points", Custom);

Leader Board Resources#

A leaderboard of each player's ore, gas, or ore and gas.

Action 19 · Leader Board Resources(Label, Resource);

Argument Takes Stored in the action
Label text, stored as a string-table entry bytes 4–7
Resource ore, gas, or ore and gas bytes 24–25
Leader Board Resources("Minerals", ore);

Leaderboard Computer Players#

Whether computer players appear on leaderboards: enable, disable or toggle.

Action 32 · Leaderboard Computer Players(State);

Argument Takes Stored in the action
State enable, disable or toggle byte 27
Leaderboard Computer Players(disable);

Leaderboard Goal Control#

As Leader Board Control, counting towards the goal.

Action 33 · Leaderboard Goal Control(Label, Unit, Goal);

Argument Takes Stored in the action
Label text, stored as a string-table entry bytes 4–7
Unit a unit type, or one of the unit classes bytes 24–25
Goal a whole number, 0 to 4,294,967,295 bytes 20–23
Leaderboard Goal Control("Build 10", "Terran Marine", 10);

Leaderboard Goal Control At Location#

As Leader Board Control At Location, counting towards the goal.

Action 34 · Leaderboard Goal Control At Location(Label, Unit, Goal, Location);

Argument Takes Stored in the action
Label text, stored as a string-table entry bytes 4–7
Unit a unit type, or one of the unit classes bytes 24–25
Goal a whole number, 0 to 4,294,967,295 bytes 20–23
Location a location (Anywhere is location 64) bytes 0–3
Leaderboard Goal Control At Location("Hold the hill", "Men", 5, "Hill");

Leaderboard Goal Kills#

As Leader Board Kills, counting towards the goal.

Action 36 · Leaderboard Goal Kills(Label, Unit, Goal);

Argument Takes Stored in the action
Label text, stored as a string-table entry bytes 4–7
Unit a unit type, or one of the unit classes bytes 24–25
Goal a whole number, 0 to 4,294,967,295 bytes 20–23
Leaderboard Goal Kills("First to 50", "Men", 50);

Leaderboard Goal Points#

As Leader Board Points, counting towards the goal.

Action 37 · Leaderboard Goal Points(Label, Score, Goal);

Argument Takes Stored in the action
Label text, stored as a string-table entry bytes 4–7
Score a score type bytes 24–25
Goal a whole number, 0 to 4,294,967,295 bytes 20–23
Leaderboard Goal Points("Points", Custom, 100);

Leaderboard Goal Resources#

As Leader Board Resources, counting towards the goal.

Action 35 · Leaderboard Goal Resources(Label, Goal, Resource);

Argument Takes Stored in the action
Label text, stored as a string-table entry bytes 4–7
Goal a whole number, 0 to 4,294,967,295 bytes 20–23
Resource ore, gas, or ore and gas bytes 24–25
Leaderboard Goal Resources("Mine 1000", 1000, ore);

Minimap Ping#

Pings the middle of the location on the player's minimap. Only the player the trigger runs for sees it.

Action 28 · Minimap Ping(Location);

Argument Takes Stored in the action
Location a location (Anywhere is location 64) bytes 0–3
Minimap Ping("Enemy base");

Modify Unit Energy#

Sets the energy of the number of units of the type in the location to the percentage of their maximum. Only units that use energy are changed, and the count passes over the others. Units inside a transport are not reached.

Action 50 · Modify Unit Energy(Player, Unit, Percent, Count, Location);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Percent a percentage, 0 to 100 bytes 20–23
Count a number of units, 1 to 255, or All (stored as 0) byte 27
Location a location (Anywhere is location 64) bytes 0–3
Modify Unit Energy("Current Player", "Terran Ghost", 100, All, "Anywhere");

Modify Unit Hanger Count#

Adds the amount of interceptors to carriers, or scarabs to reavers, for the number of units of the type in the location, up to the most each can hold. A unit that has no room for more does not use up the count.

Action 53 · Modify Unit Hanger Count(Player, Unit, Amount, Count, Location);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Amount a whole number, 0 to 4,294,967,295 bytes 20–23
Count a number of units, 1 to 255, or All (stored as 0) byte 27
Location a location (Anywhere is location 64) bytes 0–3
Modify Unit Hanger Count("Current Player", "Protoss Carrier", 8, All, "Anywhere");

Modify Unit Hit Points#

Sets the hit points of the number of units of the type in the location to the percentage of their maximum. A unit is never left below 1/256 of a hit point, so 0% does not kill it. Units inside a transport are not reached.

Action 49 · Modify Unit Hit Points(Player, Unit, Percent, Count, Location);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Percent a percentage, 0 to 100 bytes 20–23
Count a number of units, 1 to 255, or All (stored as 0) byte 27
Location a location (Anywhere is location 64) bytes 0–3
Modify Unit Hit Points("Player 8", "Men", 50, All, "Anywhere");

Modify Unit Resource Amount#

Sets how much ore or gas the mineral fields and geysers of the player in the location hold. There is no unit argument: it applies to every resource the player owns there. The amount is kept to 16 bits, so 100,000 becomes 34,464.

Action 52 · Modify Unit Resource Amount(Player, Amount, Count, Location);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Amount a whole number, 0 to 4,294,967,295 bytes 20–23
Count a number of units, 1 to 255, or All (stored as 0) byte 27
Location a location (Anywhere is location 64) bytes 0–3
Modify Unit Resource Amount("Player 12", 1500, All, "Main");

Modify Unit Shield Points#

Sets the shields of the number of units of the type in the location to the percentage of their maximum.

Action 51 · Modify Unit Shield Points(Player, Unit, Percent, Count, Location);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Percent a percentage, 0 to 100 bytes 20–23
Count a number of units, 1 to 255, or All (stored as 0) byte 27
Location a location (Anywhere is location 64) bytes 0–3
Modify Unit Shield Points("Current Player", "Protoss Zealot", 100, All, "Anywhere");

Move Location#

Centres the second location (Move) on a unit of the type owned by the player inside the first (Unit at). Following a unit with a location, so that other triggers can act around it, is done with this. With no such unit, the second location is centred on the first. The moved location keeps its size and is kept inside the map. Anywhere can be moved too.

Action 38 · Move Location(Player, Unit, Unit at, Move);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Unit at a location (Anywhere is location 64) bytes 0–3
Move a location (Anywhere is location 64) bytes 20–23
Move Location("Current Player", "Terran Marine", "Anywhere", "Hero");

Move Unit#

Moves the number of units of the type from one location to the middle of another, at once. With a group as the player, the count is for the whole group. A unit that does not fit there goes to the nearest spot it fits.

Action 39 · Move Unit(Player, Unit, Count, From, To);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Count a number of units, 1 to 255, or All (stored as 0) byte 27
From a location (Anywhere is location 64) bytes 0–3
To a location (Anywhere is location 64) bytes 20–23
Move Unit("Current Player", "Men", All, "Teleporter", "Exit");

Mute Unit Speech#

Silences the voices of units, so that a transmission or a sound can be heard over them. Unmute Unit Speech turns them back on.

Action 30 · Mute Unit Speech();

It takes no arguments.

Mute Unit Speech();

Order#

Orders the player's units of the type in one location to move, patrol or attack towards the middle of another. It orders all of them; there is no count.

Action 46 · Order(Player, Unit, From, To, Order);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
From a location (Anywhere is location 64) bytes 0–3
To a location (Anywhere is location 64) bytes 20–23
Order move, patrol or attack byte 27
Order("Player 8", "Men", "Spawn", "Base", attack);

Pause Game#

Pauses the game. It works in single player only, and only for a person's trigger; in a multiplayer game it does nothing. The triggers keep running while the game is paused: waits count down and passes go on, but the game clock and the countdown stop. The game is unpaused when the trigger that paused it finishes.

Action 5 · Pause Game();

It takes no arguments.

Pause Game();

Pause Timer#

Stops the countdown timer where it is.

Action 54 · Pause Timer();

It takes no arguments.

Pause Timer();

Play WAV#

Plays a sound for the player. The file is one stored in the map archive, which the editor's Sound Editor adds, or one of the game's own sounds by its path, such as sound\Terran\Marine\TMaYes00.wav. A sound of the game's needs no file in the map; the Trigger Editor's Browse… lists them. Duration is the sound's length in milliseconds, which editors fill in from the file. The game does not use it: Play WAV never holds the trigger, so the next action runs while the sound plays. Only the player the trigger runs for hears it.

Action 8 · Play WAV(WAV, Duration);

Argument Takes Stored in the action
WAV the name of a sound file in the map, stored as a string-table entry bytes 8–11
Duration a time in milliseconds bytes 12–15
Play WAV("staredit\\wav\\alarm.wav", 1500);

Preserve Trigger#

Keeps the trigger after it runs, so it runs again on every cycle its conditions hold. Without it a trigger runs once for each player it runs for. The trigger's Preserved flag (0x04) does the same.

Action 3 · Preserve Trigger();

It takes no arguments.

Preserve Trigger();

Remove Unit#

Removes every unit of the type the player owns, anywhere on the map, without a death animation. Like Kill Unit, it adds nothing to death counts, kills or score.

Action 24 · Remove Unit(Player, Unit);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Remove Unit("Player 12", "Map Revealer");

Remove Unit At Location#

As Remove Unit, for the number of units of the type in the location.

Action 25 · Remove Unit At Location(Player, Unit, Count, Location);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Count a number of units, 1 to 255, or All (stored as 0) byte 27
Location a location (Anywhere is location 64) bytes 0–3
Remove Unit At Location("All Players", "Men", All, "Void");

Run AI Script#

Starts an AI script for the player, which is normally a computer player: the custom-level scripts that make it play a normal game, or one of the small scripts that change its behaviour. For anyone but a computer player (a person, a rescuable slot or a neutral slot) the game runs only the scripts that make sense for them: the bunker, transport and web scripts (EnBk, EnTr, ExTr, DWHe, PB3F) and the shared-vision ones (+Vi and −Vi), and for a neutral slot also Rscu. It ignores any other.

Action 15 · Run AI Script(Script);

Argument Takes Stored in the action
Script an AI script, stored as its four-letter code bytes 20–23
Run AI Script("Terran Expansion Custom Level");

Run AI Script At Location#

As Run AI Script, for the scripts that act on a place, such as Value This Area Higher or Make These Units Patrol.

Action 16 · Run AI Script At Location(Script, Location);

Argument Takes Stored in the action
Script an AI script, stored as its four-letter code bytes 20–23
Location a location (Anywhere is location 64) bytes 0–3
Run AI Script At Location("Value This Area Higher", "Expansion");

Set Alliance Status#

Sets how the player the trigger runs for stands towards the Player argument: enemy, ally, or ally for victory. Any status value other than ally and allied victory makes them enemies.

Making a player an ally, or an ally for victory, also changes every other player the trigger's player was already allied with to the same kind of alliance.

Action 57 · Set Alliance Status(Player, Status);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Status Enemy, Ally or Allied Victory bytes 24–25
Set Alliance Status("Force 1", Allied Victory);

Set Countdown Timer#

Sets the countdown timer shown at the top of the screen, adds to it or takes from it, in seconds. Countdown Timer tests it. The timer stays between 0 and 359,999 seconds. When it reaches 0 the game goes through the triggers on the next frame.

Action 14 · Set Countdown Timer(Modifier, Seconds);

Argument Takes Stored in the action
Modifier Set To, Add or Subtract byte 27
Seconds a whole number, 0 to 4,294,967,295 bytes 12–15
Set Countdown Timer(Set To, 300);

Set Deaths#

Changes the player's death count for the unit type. It is how maps keep numbers: nothing but Set Deaths and units dying in the game changes a death count, so the counts of unit types a map never uses can hold anything.

Add past 4,294,967,295 wraps around to 0, and Subtract stops at 0. It writes nothing for a player above Player 8 or a unit number above 232, so in 1.16.1 it cannot reach memory outside the table (see EUD). Remastered is the same unless the map uses EUD triggers.

The unit classes do not work as counters. Set Deaths of Any unit writes nothing. Men, Buildings and Factories change the player's real counts of those lost, the ones the game adds to whenever such a unit dies, so a number kept there is mixed with real deaths (see Deaths and kills).

Action 45 · Set Deaths(Player, Unit, Modifier, Amount);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Modifier Set To, Add or Subtract byte 27
Amount a whole number, 0 to 4,294,967,295 bytes 20–23
Set Deaths("Current Player", "Cave (Unused)", Add, 1);

Set Doodad State#

Turns doodad units in the location on or off: the doors and traps of the Installation and other tilesets, which the map places as units. It changes only the first such unit it finds in the location, not all of them.

Action 42 · Set Doodad State(Player, Unit, Location, State);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Location a location (Anywhere is location 64) bytes 0–3
State enable, disable or toggle byte 27
Set Doodad State("All Players", "Right Upper Level Door", "Door", disable);

Set Invincibility#

Makes the player's units of the type in the location invincible, or takes it away. Units aboard the player's transports there are changed too. A unit type that is invincible in the game's own data stays invincible.

Action 43 · Set Invincibility(Player, Unit, Location, State);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Location a location (Anywhere is location 64) bytes 0–3
State enable, disable or toggle byte 27
Set Invincibility("Player 8", "Buildings", "Anywhere", enable);

Set Mission Objectives#

Sets the text of the player's mission objectives screen.

Action 12 · Set Mission Objectives(Text);

Argument Takes Stored in the action
Text text, stored as a string-table entry bytes 4–7
Set Mission Objectives("Destroy the Zerg hive.");

Set Next Scenario#

Chooses the map that follows when the player wins, as a campaign does. The text is the scenario's name.

Action 41 · Set Next Scenario(Scenario);

Argument Takes Stored in the action
Scenario text, stored as a string-table entry bytes 4–7
Set Next Scenario("Episode 2");

Set Resources#

Sets the player's ore, gas, or both, adds to it or takes from it. With ore and gas, each gets the whole amount. Add past 4,294,967,295 wraps around to 0, and Subtract stops at 0. Blizzard's melee maps give every player their starting minerals with it, when they are played as Use Map Settings.

Action 26 · Set Resources(Player, Modifier, Amount, Resource);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Modifier Set To, Add or Subtract byte 27
Amount a whole number, 0 to 4,294,967,295 bytes 20–23
Resource ore, gas, or ore and gas bytes 24–25
Set Resources("Current Player", Set To, 50, ore);

Set Score#

Sets the player's score of the kind, adds to it or takes from it. Custom is the score maps keep for themselves, often shown with Leader Board Points. A kind that is a sum of others is shared out between them: Total adds or takes a quarter of the amount, rounded up, to each of units, buildings, kills and razings (Custom is left alone), and the two kinds that are pairs half to each.

Action 27 · Set Score(Player, Modifier, Amount, Score);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Modifier Set To, Add or Subtract byte 27
Amount a whole number, 0 to 4,294,967,295 bytes 20–23
Score a score type bytes 24–25
Set Score("Current Player", Add, 10, Custom);

Set Switch#

Sets, clears, toggles or randomizes the switch. Randomize sets or clears it at random, with one draw of the game's random numbers, the same on every machine.

Action 13 · Set Switch(Switch, Action);

Argument Takes Stored in the action
Switch one of the 256 switches bytes 20–23
Action set, clear, toggle or randomize byte 27
Set Switch("Switch 1", set);

Talking Portrait#

Shows the unit type's portrait talking in the player's portrait box for the time. It does not hold the trigger. Only the player the trigger runs for sees it.

Action 29 · Talking Portrait(Unit, Duration);

Argument Takes Stored in the action
Unit a unit type, or one of the unit classes bytes 24–25
Duration a time in milliseconds bytes 12–15
Talking Portrait("Jim Raynor (Marine)", 3000);

Transmission#

A message from a unit: the unit type's portrait talks, the text is shown and the sound plays. The first unit of the type in the location, whoever owns it, blinks and is pinged on the minimap; with none there, nothing is pinged. Like a Wait, it holds the rest of the trigger until it is over, in the player's wait slot. How long that is starts from the sound's length (WAV duration) and is changed by the modifier and Duration: Set To replaces it, Add and Subtract change it.

In a single-player game it holds until the portrait has finished talking; in a multiplayer game for that time, in milliseconds of game speed. For a computer player it shows nothing and holds nothing, and without a location it does nothing at all.

Action 7 · Transmission(Display, Text, Unit, Location, Modifier, Duration, WAV, WAV duration);

Argument Takes Stored in the action
Display Always Display or Don't Always Display bit 0x04 of byte 28
Text text, stored as a string-table entry bytes 4–7
Unit a unit type, or one of the unit classes bytes 24–25
Location a location (Anywhere is location 64) bytes 0–3
Modifier Set To, Add or Subtract byte 27
Duration a time in milliseconds bytes 20–23
WAV the name of a sound file in the map, stored as a string-table entry bytes 8–11
WAV duration a time in milliseconds bytes 12–15
Transmission(Always Display, "Hold this position.", "Jim Raynor (Marine)", "Base", Add, 0, "staredit\\wav\\raynor.wav", 2400);

Unmute Unit Speech#

Lets unit voices play again after Mute Unit Speech.

Action 31 · Unmute Unit Speech();

It takes no arguments.

Unmute Unit Speech();

Unpause Game#

Resumes a game that Pause Game stopped. Single player only.

Action 6 · Unpause Game();

It takes no arguments.

Unpause Game();

Unpause Timer#

Restarts the countdown timer after Pause Timer.

Action 55 · Unpause Timer();

It takes no arguments.

Unpause Timer();

Victory#

The player wins. Every other player still in the game who has no result in the same pass is defeated, and if every player wins in the same pass it is a draw for all. See Winning and losing.

Action 1 · Victory();

It takes no arguments.

Victory();

Wait#

Holds the rest of the trigger's actions for the time, in milliseconds at the game's speed: Wait(1000) is 25 frames at Fastest and 16 at Normal. See Waits for the frames at every speed and how a player's waits hold each other up, and Hyper triggers for Wait(0).

Action 4 · Wait(Milliseconds);

Argument Takes Stored in the action
Milliseconds a time in milliseconds bytes 12–15
Wait(1000);

Disable Debug Mode#

In the game's list of actions, but StarEdit does not offer it. It stops the Esc key from skipping this trigger: in a single-player game Esc normally skips the person's running triggers through their Waits, transmissions, text and sounds, as for a cinematic. Enable Debug Mode allows it again.

Action 58 · Disable Debug Mode();

It takes no arguments.

Enable Debug Mode#

Lets the Esc key skip this trigger again after Disable Debug Mode. Not offered by StarEdit.

Action 59 · Enable Debug Mode();

It takes no arguments.

scmJS 0.18.0 · Generated from the repository. The source is under the MIT license, which does not cover what ATTRIBUTION.md lists. StarCraft and Brood War are trademarks of Blizzard Entertainment; this project ships none of their data.