SCRMaps
/
Sign in

Counting players and handling arrivals

Work out who is present, and give each of them a start.

3 min read

A map does not know how many people will join. The count feeds minimum-player checks, difficulty and reward sharing, so you almost always need it.

Trigger { -- 각 플레이어마다 한 번씩
	players = {Force1},
	conditions = {
		Command(CurrentPlayer, AtLeast, 1, "Terran Marine");
		Deaths(CurrentPlayer, Exactly, 0, "Joined");
	},
	actions = {
		SetDeaths(CurrentPlayer, SetTo, 1, "Joined");
		SetDeaths(P8, Add, 1, "PlayerCount");
		SetDeaths(CurrentPlayer, SetTo, 1, "Level");
		DisplayText("\x13\x07환영합니다");
		PreserveTrigger();
	},
}
The “Joined” counter is what makes this run once per player. A switch cannot do this job because there is only one of it for the whole map.

To scale difficulty by headcount, put PlayerCount straight into the condition.

Trigger { -- 4명 이상이면 보스 체력을 올린다
	players = {P8},
	conditions = {
		Deaths(P8, AtLeast, 4, "PlayerCount");
		Command(P8, AtLeast, 1, "Boss Unit");
	},
	actions = {
		ModifyUnitHitPoints(All, "Boss Unit", P8, "Boss Room", 100);
		PreserveTrigger();
	},
}

A player who leaves keeps their counters. To keep PlayerCount honest you either move to EUD, where f_playerexist exists, or recount each time from who still owns a unit.

Sign in to track your progress