SCRMaps
/
Sign in

Anatomy of a trigger

Players, conditions, actions. That is the whole thing.

2 min read

A trigger has three parts: whose trigger it is (players), when it fires (conditions), and what it does (actions). In TrigEditPlus it looks like this.

Trigger {
	players = {P3},
	conditions = {
		Command(CurrentPlayer, AtLeast, 1, "Terran Marine");
	},
	actions = {
		SetDeaths(P8, Add, 1, "PlayerCount");
	},
}
If P3 owns at least one marine, add 1 to P8's PlayerCount death value. This is the simplest form of counting how many players are present.

Multiple conditions must all be true. There is no OR. If you need “A or B”, you write two triggers.

CurrentPlayer means “whoever is running this trigger right now”. List several players and the trigger runs once per player, from that player's point of view. This is the single biggest tool for keeping a trigger file short.

Triggers are evaluated player by player, P1 through P8, and within a player in file order. When several triggers read and write the same value, that order changes the result.

Sign in to track your progress