2.3 KiB
How It Works
Assets
Each minigame is a MinigameDefinition asset loaded from Server/Minigames/. Hytale's asset store owns loading and editor integration.
Runtime
When a minigame starts, the runtime service creates a MinigameRuntime keyed by runtime ID. Runtime state tracks phase, players, teams, scores, lives, counters, objectives, spectators, eliminated players, map ID, and variant ID.
Events
Runtime lifecycle events are emitted as MinigameEvent and dispatched through Hytale's event bus.
Current emitted event IDs:
on_game_starton_game_endon_arena_reseton_phase_changeon_round_starton_round_endon_game_rounds_completeon_timer_expiredon_player_eliminatedon_objective_completeon_kill_score
Trigger Conditions
Minigame conditions are Hytale TriggerCondition types. They check runtime state and can be attached to normal Hytale trigger volumes or trigger effect assets.
Current condition type IDs:
MinigamePhasePlayerInMinigamePlayerStatusPlayerScoreTeamScoreCounterCurrentRoundPlayerLivesTeamConditionTimerElapsedObjectiveStatusWinConditionMet
Trigger Effects
Minigame effects are Hytale TriggerEffect types. They mutate runtime state or call runtime lifecycle operations.
Current effect type IDs:
StartMinigameEndMinigameResetMinigameSetMinigamePhaseResetScoresModifyPlayerScoreModifyTeamScoreModifyCounterModifyPlayerLivesSetPlayerStatusJoinMinigameQueueLeaveMinigameQueueVoteForMapStartQueuedMinigameSpawnItemSetRoundStartTimerStopTimerSetSpawnPointRespawnPlayerSendMinigameMessageAssignTeamSaveInventoryRestoreInventoryClearInventorySetObjectiveStatusModifyObjectiveProgressAwardKillScore
Volumes
Volumes are Hytale trigger volumes. core-minigames does not define separate volume classes.
The normal flow is:
Hytale trigger volume fires
|
v
Minigame TriggerCondition entries evaluate
|
v
Minigame TriggerEffect entries execute
|
v
MinigameRuntime changes
Fields named MinigameId are registered as asset picker fields, so the editor can show loaded minigame assets as dropdown options.