An escape map is two rules: touching a trap kills you, and dying returns you to your last checkpoint. All it needs is one counter holding how far you have got.
Trigger { -- 체크포인트를 순서대로만 인정한다
players = {Force1},
conditions = {
Bring(CurrentPlayer, AtLeast, 1, "Men", "Check 2");
Deaths(CurrentPlayer, Exactly, 1, "Checkpoint");
},
actions = {
SetDeaths(CurrentPlayer, SetTo, 2, "Checkpoint");
DisplayText("\x13\x07체크포인트 2");
PreserveTrigger();
},
}The trap side is simpler: enter the trap location, die, and get put back at whichever point the counter says.
Trigger { -- 함정: 체크포인트 2까지 온 사람
players = {Force1},
conditions = {
Bring(CurrentPlayer, AtLeast, 1, "Men", "Trap");
Deaths(CurrentPlayer, Exactly, 2, "Checkpoint");
},
actions = {
MoveUnit(All, "Men", CurrentPlayer, "Trap", "Respawn 2");
DisplayText("\x13\x06다시 시작");
PreserveTrigger();
},
}To avoid the repetition, keep one respawn location per player and move it with MoveLocation as they pass each checkpoint - then the trap needs only one trigger. The catch is that the location cannot be shared, so you need one per player.
Move the unit rather than killing it. KillUnit in an escape map leaves the player with nothing and drops them out of the game; if there is somewhere to put them back, move them.
