SCRMaps
/
Sign in

Rounds and teams

The structure arena, PvP and survival maps share.

7 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.

To re-team during the game - a map that reshuffles sides every round - the force settings chosen in the lobby can themselves be changed with EUD. Unlike faking it with ally actions, this changes the force.

The force addresses
0x58D5B0One byte per player: which force, counting from 0.
0x58D5B8One byte per force, four of them: bit 0 randomize location, bit 1 ally, bit 2 allied victory, bit 3 shared vision.
0x58D5BCThe force names.

That shared vision and allied victory are one bit each is the useful part: instead of issuing ally actions per player every round, one byte of force flags does it.

Sign in to track your progress