Wagboss Tracker
Based on game build 714014 | Last updated: 2026-03-03
Overview
WagbossTracker is a world-scoped component that records and persists the defeat state of the Wagboss boss. It maintains a single boolean flag (wagboss_defeated) and broadcasts updates to the entire game world via the master_wagbossinfoupdate event whenever the defeat state changes — for example, when the wagboss_defeated event is received or when component data is loaded from a save.
Usage example
local inst = TheWorld
inst:AddComponent("wagboss_tracker")
-- Check if Wagboss is defeated
if inst.components.wagboss_tracker:IsWagbossDefeated() then
print("Wagboss has been defeated.")
end
Dependencies & tags
Components used: None identified
Tags: None identified
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
wagboss_defeated | boolean | false | Whether the Wagboss has been defeated. |
Main functions
IsWagbossDefeated()
- Description: Returns the current defeat state of the Wagboss.
- Parameters: None.
- Returns:
boolean—trueif the Wagboss has been defeated, otherwisefalse.
OnWagbossDefeated()
- Description: Sets the defeat state to
trueand broadcasts a world update event (master_wagbossinfoupdate) with the new state. - Parameters: None.
- Returns: Nothing.
- Error states: None — this function is only called in response to the
wagboss_defeatedevent.
OnSave()
- Description: serializes the component's state for saving.
- Parameters: None.
- Returns:
table— a table containing{ wagboss_defeated = self.wagboss_defeated }.
OnLoad(data)
- Description: Restores the component's state from saved data and re-broadcasts the current Wagboss defeat status.
- Parameters:
data(table ornil) — data saved byOnSave, typically containing thewagboss_defeatedboolean. - Returns: Nothing.
- Error states: If
dataisnil, the function exits early without modifying state or emitting events.
Events & listeners
- Listens to:
wagboss_defeated— triggersOnWagbossDefeated()to record defeat and notify the world. - Pushes:
master_wagbossinfoupdate— fires with payload{ isdefeated = boolean }when defeat state changes or after load.