SCRMaps
/
Sign in

Rounds and teams

The structure arena, PvP and survival maps share.

5 min read

A round-based map cycles through states: setup, fight, scoring, setup again. The simplest structure keeps that state in one counter with a trigger per state.

Trigger { -- 준비 단계: 생성하고 전투로 넘어간다
	players = {P8},
	conditions = {
		Deaths(P8, Exactly, 0, "RoundState");
	},
	actions = {
		SetDeaths(P8, SetTo, 1, "RoundState");
		SetDeaths(P8, SetTo, 0, "RoundTimer");
		CreateUnit(1, "Terran Marine", "Arena Spawn", All);
		DisplayText("\x13\x03라운드 시작");
		PreserveTrigger();
	},
}

Trigger { -- 전투 단계: 60초가 지나면 정산
	players = {P8},
	conditions = {
		Deaths(P8, Exactly, 1, "RoundState");
		Deaths(P8, AtLeast, 1440, "RoundTimer");
	},
	actions = {
		SetDeaths(P8, SetTo, 2, "RoundState");
		PreserveTrigger();
	},
}
1440 is sixty seconds. Holding the state as a number lets any trigger ask “which phase are we in” with a single condition.

Teams are normally forces, but sometimes you have to assign them in triggers regardless of the lobby. Then a per-player counter holds the team number.

Trigger { -- 들어오는 순서대로 번갈아 배정
	players = {Force1},
	conditions = {
		Deaths(CurrentPlayer, Exactly, 0, "Team");
		Command(CurrentPlayer, AtLeast, 1, "Terran Marine");
		Switch("Next Is Team A", Set);
	},
	actions = {
		SetDeaths(CurrentPlayer, SetTo, 1, "Team");
		SetSwitch("Next Is Team A", Clear);
		SetDeaths(P8, Add, 1, "TeamACount");
		PreserveTrigger();
	},
}
Flipping a switch back and forth splits the players evenly. The team B trigger is the mirror image with the switch condition set to NotSet.

Gather everything that resets each round into one trigger. Scattered resets are how leftover values start producing strange behaviour a few rounds in.

Sign in to track your progress