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();
},
}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();
},
}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.
| 0x58D5B0 | One byte per player: which force, counting from 0. |
|---|---|
| 0x58D5B8 | One byte per force, four of them: bit 0 randomize location, bit 1 ally, bit 2 allied victory, bit 3 shared vision. |
| 0x58D5BC | The 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.
