Homesign
Based on game build 7140014 | Last updated: 2026-03-05
Overview
homesign is a prefab that defines a wooden signpost structure. It functions as a placeable in-world object with writeable text, structural resilience, and damage-based interactions. It integrates with multiple core systems: it is workable via the hammer action (which extinguishes fire and drops loot), supports burning via burnable/propagator, and persists its burnt state across saves using onsave/onload callbacks. It is typically used as a landmark or customizable marker in the world.
Usage example
-- Internally used by the game to create the sign prefab
return Prefab("homesign", fn, assets, prefabs),
MakePlacer("homesign_placer", "sign_home", "sign_home", "idle")
No direct modder usage is required; modders may spawn instances via SpawnPrefab("homesign") or extend the definition in custom prefabs.
Dependencies & tags
Components used: burnable, lootdropper, workable, inspectable, writeable, propagator, fueled, hauntable
Tags added: structure, sign, _writeable (temporary, removed on master sim)
Tags checked: burnt, burnable, debris
Properties
No public properties exposed by this prefab itself. Component properties (e.g., workable.workleft, burnable.burning) are managed internally via component APIs.
Main functions
The functions below are callbacks used during the sign’s lifecycle, not methods called directly by modders.
onhammered(inst, worker)
- Description: Callback fired when the sign is fully hammered (e.g., broken). Extinguishes fire (if burning), drops loot, spawns a
collapse_smallFX, and removes the entity. - Parameters:
inst(Entity),worker(Entity or nil) — the entity performing the hammer action. - Returns: Nothing.
- Error states: Safe to call even if
burnablecomponent is missing; only extinguishes if present and burning.
onhit(inst, worker)
- Description: Callback fired during partial hammering (before completion). Triggers a hit animation (if not burnt).
- Parameters:
inst(Entity),worker(Entity or nil). - Returns: Nothing.
- Error states: No effect if
burnttag is present; plays only a single-frame "hit" animation before returning to idle.
onsave(inst, data)
- Description: Saves the sign’s burnt state into the save data table.
- Parameters:
inst(Entity),data(table) — the save data object to mutate. - Returns: Nothing. Sets
data.burnt = trueif the sign is currently burnt or burning.
onload(inst, data)
- Description: Restores burnt state on world load. Invokes
onburntcallback ifdata.burntis true. - Parameters:
inst(Entity),data(table or nil) — loaded save data. - Returns: Nothing.
- Error states: Safely handles
data == nilor missingdata.burnt.
onbuilt(inst)
- Description: Event callback triggered when the sign is first built (placed). Plays the "dontstarve/common/sign_craft" sound.
- Parameters:
inst(Entity). - Returns: Nothing.
Events & listeners
- Listens to:
onbuilt— firesonbuiltcallback to play build sound. - Pushes: None directly (relies on components for events like
onburnt,onextinguish).
<!-- Note: Entity-level events like onburnt or onextinguish are triggered by attached components and are not defined in this file, so they are omitted. -->