Wagboss Tracker
Overview
This component monitors the defeat status of the Wagboss boss entity and ensures that world-wide updates are broadcast when its state changes. It persists its state across saves and loads, synchronizing the Wagboss defeat condition globally.
Dependencies & Tags
- Depends on the entity having
OnSaveandOnLoadcalled by the entity's save/load system. - Registers a listener for the
"wagboss_defeated"event on its host entity. - Pushes the
"master_wagbossinfoupdate"event toTheWorldupon defeat or load.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
wagboss_defeated | boolean | false | Tracks whether the Wagboss has been defeated. |
Main Functions
IsWagbossDefeated()
- Description: Returns the current defeat status of the Wagboss.
- Parameters: None.
OnSave()
- Description: Serializes the component’s state for saving. Returns a table containing
wagboss_defeated. - Parameters: None.
OnLoad(data)
- Description: Restores the component’s state from saved data. If data is present, it updates
wagboss_defeatedand broadcasts the"master_wagbossinfoupdate"event to reflect the restored state. - Parameters:
data(table?): Optional table containing saved state, specifically awagboss_defeatedkey.
Events & Listeners
- Listens for:
"wagboss_defeated"— triggersOnWagbossDefeatedto mark the boss as defeated and notify the world. - Triggers:
"master_wagbossinfoupdate"— pushed toTheWorldwhen the Wagboss is defeated or when state is loaded, carrying{isdefeated = boolean}.