Deerclopsspawner
Based on game build 714014 | Last updated: 2026-03-03
Overview
Deerclopsspawner orchestrates Deerclops boss spawns during winter (and optionally off-season) in DST. It monitors active players, calculates attack timing based on season length and configured rates, selects a valid target player and location, and spawns the deerclops entity when conditions are met. It interacts with the worldsettingstimer, areaaware, knownlocations, and talker components to manage state, movement, and player announcements.
Usage example
-- Typically added automatically to the world entity during init:
-- TheWorld.components.deerclopsspawner = TheWorld:AddComponent("deerclopsspawner")
-- No manual usage is intended; it operates as a singleton world component.
Dependencies & tags
Components used: worldsettingstimer, areaaware, knownlocations, talker
Tags: Checks nohasslers on player areas; no tags added or removed by this component.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
inst | Entity | nil | Owner entity (always TheWorld in mastersim). |
Main functions
OnPostInit()
- Description: Initializes the Deerclops attack timer based on season tuning and starts the attack cycle. Called once when the component is added to
TheWorld. - Parameters: None.
- Returns: Nothing.
DoWarningSpeech(targetPlayer)
- Description: Triggers Deerclops warning speech for players near the target player.
- Parameters:
targetPlayer(Entity) — the player selected as the Deerclops target. - Returns: Nothing.
DoWarningSound(targetPlayer)
- Description: Spawns a
deerclopswarning_lvlXprefab at the target player’s position based on time-to-attack. Warning level depends on how soon the Deerclops is expected (4= imminent). - Parameters:
targetPlayer(Entity) — the player selected as the Deerclops target. - Returns: Nothing.
OnUpdate(dt)
- Description: Handles warning state progression: tracks time-to-attack, toggles
_warningflag, and schedules warning sounds and speech at diminishing intervals as the spawn time approaches. - Parameters:
dt(number) — delta time in seconds since last frame. - Returns: Nothing.
- Error states: Returns early and resets if
_activehassleris present or timer is nil.
LongUpdate(dt)
- Description: Alias for
OnUpdate; required for component update scheduling. - Parameters:
dt(number) — delta time. - Returns: Nothing.
SummonMonster(player)
- Description: Forces Deerclops to spawn within 10 seconds, overriding normal timing. Used for debug or quest triggers.
- Parameters:
player(Entity) — ignored; retained for API consistency. - Returns: Nothing.
GetDebugString()
- Description: Returns a human-readable string describing current Deerclops state (e.g., waiting, warning, attacking).
- Parameters: None.
- Returns:
string— formatted debug info.
Events & listeners
- Listens to:
ms_playerjoined— adds player to_activeplayersand triggers attack checks.ms_playerleft— removes player from_activeplayers; if leaving player is the current target, callsTargetLost.season(world state) — triggersTryStartAttackson season change.hasslerremoved— resets_activehasslerand re-evaluates attacks.hasslerkilled— sets_activehassler = nil, increases next attack delay, and re-evaluates attacks.storehassler— savesdeerclopssave record for reuse (prevents duplicate spawns).megaflare_detonated— may trigger immediate attack based on RNG, range, and season.
- Pushes: None directly. Events are only consumed internally.
Save/Load integration
OnSave()— returns table with_warning,_storedhassler, and optionally_activehassler.GUID. Also returns list of entity GUIDs to persist.OnLoad(data)— restores_warningand_storedhassler; supports old_timetoattackfield for backwards compatibility.LoadPostPass(newents, savedata)— resolves_activehasslerreference after entity restoration.