- Implemented LeaveMinigameQueueEffect to handle player removal from queues and runtime. - Added OpenMinigameQueueUIEffect to manage the opening of the minigame queue UI. - Introduced StartPlayerTimerEffect and StopPlayerTimerEffect for managing player timers and scoring. - Enhanced PlaceBlocksEffect with options for filling volumes and hollow placements. - Updated SpawnItemEffect to fix codec handling for item IDs. - Added MountPlayerEffect and DismountPlayerEffect for player interactions with NPCs. - Improved StartQueuedMinigameEffect to check player counts before starting games. - Added localization entries for new effects and UI elements. - Updated manifest to include HyUI as a dependency.
3.5 KiB
King of the Hill — Ending & Resetting
This step covers what happens when the game ends, what signals fire and when, and how to use arena reset to prepare for the next game.
What Happens When the Game Ends
When the final round timer expires (and no overtime/sudden death is configured), the runtime calls end("rounds_complete") automatically. The full sequence:
- HUDs removed for all players in the runtime.
- Phase set to
ENDING→SignalPhaseStart=ENDINGfires. - Active signal timers cancelled.
- Temporary entities cleaned up (spawned NPCs/items tracked by the runtime).
- Player inventories restored (since
RestorePlayerInventory = trueis the default). - Rewards distributed (if any
Rewardsare defined in the definition). on_game_endevent dispatched withreason = "rounds_complete"and final scores.- Runtime state cleared — scores, player status, timers, counters all zeroed.
- Runtime removed from the active list.
- Phase set to
RESETTING→SignalPhaseStart=RESETTINGfires. on_arena_resetevent dispatched (sinceResetOnEnd = trueis the default).
You do not need to manually reset scores or clear HUDs.
ENDING Phase Volume (Optional)
Use SignalPhaseStart=ENDING to show a scoreboard, announce the winner, or freeze players briefly before cleanup. This fires while the runtime still holds final scores.
Tags:
| Tag | Value |
|---|---|
MinigameId |
King_Of_The_Hill |
MapId |
Hillside |
SignalPhaseStart |
ENDING |
Example effects:
| Effect | Fields |
|---|---|
SendMinigameMessage |
MinigameId = King_Of_The_Hill, MessageKey = game_over, Target = ALL |
Arena Reset Volume
Use SignalPhaseStart=RESETTING to restore any world state changed during the game. This fires after the runtime has been cleaned up, so it is safe to re-enable the queue pad without risk of double-triggering.
Scope note:
SignalPhaseStart=RESETTINGis scoped byMinigameIdtag match, NOT by physical containment within theMapRole=MainArenaboundary. Any volume anywhere in the world with a matchingMinigameIdtag will respond. The arena boundary volume is only used for map discovery, not for event routing.
For this King of the Hill setup there are no block placements or NPC spawns, so the arena reset volume is optional. Add it if you want to re-enable the queue pad, reset visual markers, or restore barriers changed mid-game.
Tags:
| Tag | Value |
|---|---|
MinigameId |
King_Of_The_Hill |
MapId |
Hillside |
SignalPhaseStart |
RESETTING |
Example effects:
| Effect | Fields | Purpose |
|---|---|---|
PlaceBlocks |
(coordinates of any changed areas, original block id) | Restore modified terrain. |
Repeating the Game
After the runtime ends and SignalPhaseStart=RESETTING fires, the minigame is ready to start again. Players can step back onto the queue pad and a new runtime will be created when StartQueuedMinigame fires again.
No state from the previous game persists — scores, player status, timers, and counters are all cleared by the end flow.
Manual Reset
If you need to reset the game mid-match (for testing or crash recovery), use the admin command:
/minigame reset King_Of_The_Hill
This calls ResetMinigame directly, which sets phase to RESETTING, fires SignalPhaseStart=RESETTING, clears runtime state, and dispatches on_arena_reset — without going through the normal end flow (no rewards, no inventory restore, no ENDING phase).