Log inGet started
World

First Light

Branchmain
Branchesmain
Commit5b1bfa8dc1

README.md

firstlight.sites

Everything the survivor can take, and where. Attached to the Sites anchor by the scene build. It places the props, registers each with firstlight.interact, raycasts from the player's camera every frame so Interact.current() names what the reticle is on, answers the interact and headlamp keys, and drains lamp oil and batteries into Rules.state.stores.

What it places

All of it as temporary children (never saved into the scene), rebuilt on every load from the counts kept on the blackboard:

WherePropsInteraction
workshopa crate of tins, a stack of scrap timber, a bench with a matchbox, the ice drilltake tins ×3, timber ×4, matches ×6, the drill
generatorthe engine block, two jerry cans, three coils of copper wireoil residue ×2 (0.5 L each), wire ×3
radio_hutthe battery bank, the radio desk, a matchboxbatteries ×3, matches ×4
storagea half-buried crate and salvage planks at the heap's edgetins ×4, timber ×3
living_hutthe hanging lantern and its point light; the snowed-over food cache outside the doorlight / snuff the lamp; cache fish and meat outside, bring it back in
fishing_holea cleared ice patch, the hole once drilled, a flag stakedrill the hole (needs the drill), then cast — castsPerDay casts a day at fishChance
trap_linethree traps along the hare runs, a flag stakeset the traps; check them from the next day at trapChance for meat
riverthe black ice of the frozen river between its bankslandmark
driftwooda heap of logs, a flag stakegather once a day: fuel +4
coal_seamthe outcrop and a heap of coal, a flag stakedig once a day: fuel +6
wreckthe listing hull and the ship's stores crateone search: tins +5, oil +2, batteries +2, matches +10, wire +2
caribouthe carcass, from stores.caribouDay until butcheredbutcher: meat +10

A generated model under /firstlight/sites/<name>.bundle (ice_drill, tin_crate, jerry_can, battery_bank, lantern, fox_trap, driftwood, coal, wreck, caribou) is used when it resolves and fitted to size on its first frame; otherwise the prop is built from primitives and the materials beside it.

The stove and the bunk

The body slice spawns stove and bunk under living_hut. Once a second this component looks for them, fits an interact_hit box to each, and registers them: the stove lights through firstlight.stove:light() and cycles low/high through :setLevel(n); the bunk sleeps through firstlight.hut:sleep().

The headlamp

A SpotLight child named headlamp on the player's camera rig. F (the headlamp control of firstlight.sites.outings) toggles it. Switching on with an empty lamp takes a battery from stores.batteries and fills stores.headlampCharge; it drains over headlampBatterySeconds real seconds and changes to a fresh battery by itself, or dies when there are none.

Fields

FieldDefaultMeaning
walkMap@builtin::inputMaps.defaultthe scheme whose interact control is used
outingsMapfirstlight.sites.outingsthe headlamp switch
headlampBatterySeconds240real seconds one battery lasts
lampOilPerHour0.05litres the hut lamp burns per in-game hour
fishChance0.45chance a cast lands a fish
trapChance0.55chance the traps hold something the next morning
castsPerDay5casts before the fish stop biting for the day

Every use emits interact { site, action } and a say line; every store change goes through firstlight.stores and emits stores.