SCRMaps
/
Sign in

Racing: laps and finishing order

Force the checkpoints in order, then record who arrives first.

4 min read

A race is the escape-map structure with two changes: completing a circuit resets the checkpoint counter and adds a lap, and the finish line records the order people cross it.

Trigger { -- 결승선: 마지막 체크포인트를 지난 사람만
	players = {Force1},
	conditions = {
		Bring(CurrentPlayer, AtLeast, 1, "Men", "Finish");
		Deaths(CurrentPlayer, Exactly, 4, "Checkpoint");
	},
	actions = {
		SetDeaths(CurrentPlayer, SetTo, 0, "Checkpoint");
		SetDeaths(CurrentPlayer, Add, 1, "Lap");
		PreserveTrigger();
	},
}
Resetting Checkpoint to 0 is what defines a lap. Without it, checkpoint 1 of the second lap never counts.

Placement comes from a single shared counter: whoever crosses takes its current value, and bumps it by one on the way past.

Trigger { -- 완주: 들어온 순서를 받아 적는다
	players = {Force1},
	conditions = {
		Deaths(CurrentPlayer, AtLeast, 3, "Lap");
		Deaths(CurrentPlayer, Exactly, 0, "Placed");
	},
	actions = {
		SetDeaths(CurrentPlayer, SetTo, 1, "Placed");
		SetDeaths(P8, Add, 1, "NextPlace");
		SetScore(CurrentPlayer, Add, 1, Custom);
		DisplayText("\x13\x03완주!");
		PreserveTrigger();
	},
}
Placed stops one player being recorded twice - their unit is still sitting on the finish line after they cross it.

For places to be unique, taking the shared counter and incrementing it must happen in the same trigger. Split across two and any players arriving on the same cycle get the same place.

Sign in to track your progress