Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 47b50fcd-5…

focus

One interaction target at a time, chosen by aim. Every interactable (door, light switch, seat, TV, controller, the Game Boy) offers itself each frame while the player is in its range; the focus picker takes the one the middle of the screen looks at (turning counts fully, the foll…

by◐Deata·posted 3d ago
What it does

focus

One interaction target at a time, chosen by aim. Every interactable (door, light switch, seat, TV, controller, the Game Boy) offers itself each frame while the player is in its range; the focus picker takes the one the middle of the screen looks at (turning counts fully, the follow camera's pitch only partly, since it cannot look straight down at a table), and only when nothing is under the reticle the nearest one, favouring what is in front and bigger things. Only the winner shows a prompt and only the winner acts on Interact.

Input contexts, innermost first (Focus.context()): shelf (cartridge shelf open: its own map stations.shelf stands the player's and the held console's controls down; Back = Backspace / pad B closes it), pad (a controller in hand: stations.gamepad stands the player's and hangout maps down; its own pad_watch frames the TV), handheld (the Game Boy in hand: stations.handheld), holding, seated, free. With something in hand only an offer made with a press callback is considered (a seat: sit with the item kept in hand; a held controller's "Cartridges"): it shows the prompt and the stations.holdInteract map (E / pad right-stick click / touch "Use", live only then) calls press. Seated, look (mouse / right stick) turns the seated view (stations.seatView), so the reticle picks among what lies on the table. With a Game Boy in hand and standing, its close-up looks back at the player, so a press offer (a seat) is found from the body instead: within reach of the chest, nearest first — walk up to a seat and press Interact to sit with the Game Boy kept in hand.

The player's Carrier picks nothing up by itself (stations.hands binds its control to no device): each holdable's own component offers itself here and picks itself up when it is the target.

local Focus = require("stations.focus")
-- update(): offer while in range (player-facing verb and object, aim radius in metres), withdraw otherwise
Focus.offer(public.entityId, targetEntity, "Open", "Door", 0.5)
Focus.withdraw(public.entityId)
-- in the Interact handler:
if not Focus.isTarget(public.entityId) then return end

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

strict

localAvatar( ) → any

reach(base: number) → number

How far, in metres along the floor, the local player reaches for something whose standing reach is `base`.

argtypedescription
basenumber

context( ) → string

The input context the local player is in, innermost first: "shelf" (the cartridge shelf is open), "pad" (holding a controller), "handheld" (holding the Game Boy), "holding" (anything else in hand), "seated", or "free".

aimMiss(target: any, radius: number) → number

How far the camera-centre ray passes from `target`, as a share of the target's aim radius (0 dead on, 1 at its edge), or nil when it is behind the camera. What the middle of the screen looks at is what the player means.

argtypedescription
targetany
radiusnumber

nearScore(avatar: any, target: any, radius: number) → number

With nothing under the reticle: floor distance, doubled for something off to the side of the camera's look, less the target's size (a sofa beats a controller lying the same distance away). Nothing behind the look is offered: turning away from a thing means not it.

argtypedescription
avatarany
targetany
radiusnumber

isPartOf(hitId: string, o: Offer) → boolean

argtypedescription
hitIdstring
oOffer

ownedBy(hitId: string, ownerId: string) → boolean

argtypedescription
hitIdstring
ownerIdstring

sightPoint(o: Offer) → void

the middle of the target's own parts (a door leaf's middle, not its hinge at the floor), else its position

argtypedescription
oOffer

sortedHits(from: any, dir: any, len: number, avatarId: string) → void

argtypedescription
fromany
dirany
lennumber
avatarIdstring

reaches(from: any, o: Offer, avatarId: string) → boolean

argtypedescription
fromany
oOffer
avatarIdstring

aimHitId(avatarId: string) → string

the first thing the middle of the screen meets, past the player's own body

argtypedescription
avatarIdstring

inSight(o: Offer, avatar: any, aimHit: string?, seated: boolean) → boolean

whether the local player can see `o`'s target from where they are

argtypedescription
oOffer
avatarany
aimHitstring?
seatedboolean

sight( ) → void

Debug read: each live offer (by target name and id) and whether it is in the local player's sight now.

holdable(id: string) → boolean

argtypedescription
idstring

holdLive(on: boolean) → void

argtypedescription
onboolean

decide( ) → void

soon( ) → void

offer(id: string, target: any, verb: string, object: string?, radius: number?, press: (() → void

Offer `id` as an interaction this frame, drawn at `target`'s position. `verb` and `object` are the player's words ("Pick up", "Controller"); `radius` is how far, in metres, the reticle may miss `target` and still mean it (default 0.3: about a hand's width either side). `press`, when given, makes the offer one that also takes a press while the player holds something (E / pad R3, stations.holdInteract): the picker then considers only such offers, and calls `press` when it is the target.

argtypedescription
idstring
targetany
verbstring
objectstring?
radiusnumber?
press((

withdraw(id: string) → void

Take `id`'s offer back (out of range, busy).

argtypedescription
idstring

isTarget(id: string) → boolean

Whether Interact pressed now means `id`.

argtypedescription
idstring

target( ) → string

The id Interact means now, if any.

targetIsHoldable( ) → boolean

Whether the current target is something to pick up.

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.