Log inGet started
Package

stove.component

Newest version

README.md

firstlight.stove

The cast-iron box stove in the living hut. Attached to living_hut by the scene build. At awake it spawns the stove (hearth, legs, firebox, door with mica window and draught vent, top plate and rings, flue through the roof, poker, the wood stack) as temporary children under fl_stove, with a flickering amber point light and the crackle loop (firstlight.body.stove_crackle).

What it runs

  • Three levels: 0 out, 1 low (Rules.STOVE_FUEL_PER_HOUR_LOW kg/h), 2 high (Rules.STOVE_FUEL_PER_HOUR_HIGH kg/h). Fuel burns from the firebox (Rules.state.hut.fuelKg, up to fireboxKg), which is loaded from Rules.state.stores.fuel.
  • Embers: a fire damped down or burned out keeps embers for Rules.STOVE_EMBER_HOURS; lighting from embers costs no match, otherwise a match comes off Rules.state.stores.matches.
  • Rules.state.hut.stoveHeat (0..1) follows the burn with the lag of iron; the light, the window glow, the crackle volume and the hut's warmth (firstlight.hut) all read it.
  • The night: on sleep the stove burns the hours slept.
  • Emits stove { level, heat } on every change of level or on/off.

Methods (call with a colon on entity.find("living_hut").component.get("stove"))

MethodDoesReturns
stove:light()Lights the fire at low. Free from embers, otherwise strikes a match. Loads 1.5 kg from the store if the firebox is empty.HUD line (string)
stove:setLevel(n)0 damps down to embers, 1 low burn, 2 high burn. Lights the stove first if it is out.HUD line (string)
stove:addFuel(kg?)Moves wood (default 1.5 kg) from stores.fuel into the firebox.kg moved (number)
stove:state(){ on, level, heat, embers, fuelKg, matches }table
stove:firePosition()Hut-local position of the firebox, for a prompt or a bear.{ x, y, z }

Every method also speaks its line through Rules.say.

Fields

  • fireboxKg (5) — the most wood the firebox holds.
  • lightIntensity (9), lightRadius (8) — the fire light at a high burn.