Doors open automatically when the avatar walks into them #67

Closed
opened 2026-11-08 06:18:04 +00:00 by claude · 1 comment
Member

Follow-up from #13. Doors currently only open on right-click. Walking into a closed door should open it (and optionally close it behind you after a delay if nothing is in its cells), so moving through a base doesn't need aiming.

Sketch: in the avatar step, if horizontal input is held and the cell in front of the avatar (at feet and body height) is a closed door node, call strata.set_door(pos, true). Creatures must not open doors (later NPCs may). Add a selftest using the avatar _test_ctrl hook.

Follow-up from #13. Doors currently only open on right-click. Walking into a closed door should open it (and optionally close it behind you after a delay if nothing is in its cells), so moving through a base doesn't need aiming. Sketch: in the avatar step, if horizontal input is held and the cell in front of the avatar (at feet and body height) is a closed `door` node, call `strata.set_door(pos, true)`. Creatures must not open doors (later NPCs may). Add a selftest using the avatar `_test_ctrl` hook.
claude added this to the v0.2 Core Feel milestone 2026-11-08 06:18:04 +00:00
claude added the
type
feature
area/items-crafting
priority
low
labels 2026-11-08 06:18:04 +00:00
eric closed this issue 2026-11-11 17:14:05 +00:00
Author
Member

Done in 9e8284b.

strata.open_door_ahead(pos, dir, half_width, half_height) in furniture.lua checks the cells just ahead of a walking entity, from feet to head height, and opens a closed door there. The avatar calls it while a walk key is held. Creatures don't call it, so slimes can't get in. Doors don't close by themselves; I left auto-close out, since closing behind you while something follows could trap it in the door cells (set_door already refuses to close on an entity).

Tests: a new furniture case: an avatar walking right opens a placed door and passes through; standing still, facing away or being too far doesn't open it. Removing the call from the avatar fails the case. Full suite 66/66, zero ERROR lines.

Done in 9e8284b. `strata.open_door_ahead(pos, dir, half_width, half_height)` in `furniture.lua` checks the cells just ahead of a walking entity, from feet to head height, and opens a closed door there. The avatar calls it while a walk key is held. Creatures don't call it, so slimes can't get in. Doors don't close by themselves; I left auto-close out, since closing behind you while something follows could trap it in the door cells (`set_door` already refuses to close on an entity). **Tests**: a new furniture case: an avatar walking right opens a placed door and passes through; standing still, facing away or being too far doesn't open it. Removing the call from the avatar fails the case. Full suite 66/66, zero ERROR lines.
Sign in to join this conversation.