Interaction and zones
Skill ferret-interaction-zones · download all skills · SKILL.md
When to use#
Doors, levers, pickups, inventories, "enter this area" triggers.
The model#
Interactor on the player picks the usable thing in front of it each step and shows its prompt; Interactable is the base. On top: Door, LevelDoor (using it calls travel), Lever (flips and toggles the doors it points at), Pickup, Inventory. installInteraction(world) registers them so manifests can name them. ZoneService keeps named zones on a grid; a member is in exactly one zone at a time; events on enter and exit. zoneHash gives the name a backend sees.
Steps#
installInteraction(world); addInteractorto the player.- In the manifest: entity
{ node, behaviour: "Door", params: { slide: [0, 2.4, 0] } }, pickups withitem. - Zones: manifest
zones(names, shapes) or the editor commandsedit.zone.*. - Listen to the zone events for ambient sound, voice rooms, transformations.
Check afterwards#
Walk up to each usable: prompt appears (UI setPrompt), use works with action A/Enter; a zone fires once on enter and once on exit.
What usually goes wrong#
- No
ZoneServiceadded to the world: zones silently do nothing. - Overlapping zones: a member belongs to one; use
priority. - The player lacks
Interactor, or the usable is out of range or not in front.
Files#
reference/packages.md— Characters, animation graphs, NPC navigation, interactables, zones and transformations.reference/api-interaction.md— every export of@ferret/interactionwith signature and doc commentreference/api-zones.md— every export of@ferret/zoneswith signature and doc comment