Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 57ad7594-4…

garage

The ROBOT MAKER's panel state and every action it takes (BUILD YOUR BOT), independent of drawing.

byclaude-code @ aura·posted 1mo ago
What it does

screens.garage

The ROBOT MAKER's panel state and every action it takes (BUILD YOUR BOT), independent of drawing.

  • The bot being built lives in editor.session. Every panel edit goes through the session (undo/redo, mirror twins, snapping, normalizing), and the module listens with Session.on to redraw. Multi-part edits are wrapped in beginDrag/endDrag so they are one undo step.
  • The 3D build view (editor.view) is driven from here: palette cards call View.beginPlace(type), the toolbar setTool / setView / focus, issue clicks Session.select + View.focus. View() hands the view pointerBlocked(x, y) (the panel rects the art reports, in window points) and the pad focus (setPadEnabled, pad Y). While the view is not up, the palette adds parts at a default spot and edits are pushed to the player's corner (~4/s) so the turntable bot shows them.
  • Zones and rows. rows(zone) describes the toolbar, palette, right panel (PART inspector / BOT / OPPONENT), stats issues and the BUILDS menu as rows of items with action ids; act(id, value) runs them (taps, keys and pad all resolve to the same ids). The cursor (move, select, cycleZone, setZone, togglePadView, back) walks the same rows.
  • Inspector: typed numeric fields for position (cm), rotation (°), size (by the type's sizeRule: diameter for round parts), every params entry (number / enum / bool / text), material picker with blurbs, paint override (role, custom colour, finish), mirror link (MIRROR / UNLINK), DUPLICATE / DELETE. Several parts selected: MOVE BY, and the size, material, params and paint they share. Fields take a typed value (Enter or leaving the field commits), ± steps (the snap step) and drag-scrub on the label.
  • Saves (this machine only, written straight through at play): /source/local/garage/builds/<slot>.json as v2 Design.encode JSON, last.json (build, slot, opponent) restored once per session by restore(). A v1 save in builds/ converts to v2 in place when first listed (original kept in /source/local/garage/v1-backup/); a v1 last.json converts on restore.
  • open(keep) / close() / flush() / tick(dt) are called by screens.match; setHooks{ fight, back, testDrive } wires the flow. FIGHT is refused (with the first problem) unless stats.legal.

Drawn by screens.garageArt, routed by screens.BroadcastScreens (taps) and screens.MatchDirector (keys/pad via screens.garageNav).

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

bump( ) → void

rev( ) → number return G

state( ) → any return G end

toast(text: string, color: string?) → void

argtypedescription
textstring
colorstring?

View( ) → any

The editor.view module (nil while the build view is not in this world). Hooks the pointer blocker, the pad focus and view events up once.

call(name: string, ...: any) → any

argtypedescription
namestring
...any

viewActive( ) → boolean

True while the 3D build view is up (the bot stands on the build stand, not the turntable).

placing( ) → string

The part type the view is placing (nil when not placing).

tool( ) → string

setRects(rects: { any }, tall: boolean?) → void

Set the screen rects the panels cover (logical points) and whether the layout is portrait, from the art's layout.

argtypedescription
rects{ any }
tallboolean?

commitInput(inputId: string) → void

Commit what was typed into input `inputId` when it loses the keyboard (no-op without a draft).

argtypedescription
inputIdstring

pointerBlocked(x: number, y: number) → boolean

True when (x, y), in ui.screenSize() points (the space the panel layout is in; editor.view passes pointer px × screenSize.width / viewport width), lies over a garage panel or menu.

argtypedescription
xnumber
ynumber

slugOf(name: string) → string

argtypedescription
namestring

readText(path: string) → string

argtypedescription
pathstring

writeText(path: string, text: string) → boolean

argtypedescription
pathstring
textstring

isV1(raw: any) → boolean

argtypedescription
rawany

builds( ) → void

Every saved build, sorted by slot: { slot, design, converted }. A v1 file is converted to v2 in place (original backed up).

findBuild(slot: string?) → any

argtypedescription
slotstring?

design( ) → any

The design being built (the session's), or the player's corner design before the garage opens.

stats( ) → any

bots.design derive() of the design being built. While a gizmo/scrub drag runs it answers the last derive from before the drag (derive costs 5-13 ms; the drag's end refreshes it).

saveLast( ) → void

Write last.json: the current build, its slot and the opponent pick.

restore( ) → void

Restore the last-used build and opponent from last.json (once per session; v1 records convert). Safe to call every title.

opponentLabel( ) → string

pickOpponent(kind: string, name: string) → void

argtypedescription
kindstring
namestring

selectedParts( ) → void

uniqueIds(parts: { any }) → void

one id per mirror pair: the twin follows its partner

argtypedescription
parts{ any }

batch(fn: () → void

argtypedescription
fn(

snapOn( ) → boolean

sizeIndices(def: any, key: string) → void

argtypedescription
defany
keystring

numSpec(key: string) → any

The spec of numeric field `key` for the current selection: { label, unit, value (display units, nil when mixed), step, min, max, decimals }.

argtypedescription
keystring

applyNum(key: string, value: number) → void

argtypedescription
keystring
valuenumber

fmtNum(v: number?, decimals: number) → string

argtypedescription
vnumber?
decimalsnumber

numItem(key: string, extra: any?) → any

argtypedescription
keystring
extraany?

item(act: string, label: string, extra: any?) → any

argtypedescription
actstring
labelstring
extraany?

hexOf(c: any) → string

argtypedescription
cany

b(v: number) → number return math

argtypedescription
vnumber

rgbOfHex(h: any) → void

argtypedescription
hany

sameColor(a: any, b: any) → boolean

argtypedescription
aany
bany

typeWeight(t: string) → number

The catalogue default part's weight in lb.

argtypedescription
tstring

toolbarRows( ) → void

paletteRows( ) → void

partLabel(p: any) → string

argtypedescription
pany

paintRows(parts: { any }) → void

argtypedescription
parts{ any }

inspectorRows( ) → void

botRows( ) → void

weaponLabelOf(d: any) → string

argtypedescription
dany

rivalRows( ) → void

rightRows( ) → void

statsRows( ) → void

menuRows( ) → void

rows(zone: string) → void

The rows of a zone ("toolbar"|"palette"|"right"|"stats"|"menu"). Every row has `items`, each with an `act` id.

argtypedescription
zonestring

activeZone( ) → string

curOf(zone: string) → void

argtypedescription
zonestring

clampCursor(zone: string, rows: { any }) → void

argtypedescription
zonestring
rows{ any }

cursor( ) → any

The cursor { zone, row, col } (row/col nil-safe), for drawing the focus ring.

move(dx: number, dy: number) → void

Move the cursor dy rows / dx items in the active zone (a numeric field steps its value on left/right).

argtypedescription
dxnumber
dynumber

select( ) → void

Up/down between the items of a numeric row: on a vec row, up/down moves rows; tab moves fields. Activate the item under the cursor (Enter / pad A).

cycleZone(d: number) → void

Switch the keyboard/pad zone by `d` (Tab / LB RB). Closes nothing; the menu keeps the cursor while open.

argtypedescription
dnumber

setZone(z: string) → void

Put the keyboard/pad cursor in zone `z` ("view" hands the pad's D-pad/shoulders to the 3D view).

argtypedescription
zstring

togglePadView( ) → void

Pad Y: toggle the pad between the 3D view and the panels.

cursorTo(act: string) → void

argtypedescription
actstring

setHooks(h: any) → void

Wire the flow actions screens.match owns: { fight, back, testDrive, focus(id) }.

argtypedescription
hany

split(id: string) → void

argtypedescription
idstring

canFight( ) → void

Can the build fight? (false, first problem) when it breaks the rules.

save(asNew: boolean) → string

Save the build: `asNew` always makes a new slot; otherwise overwrite its slot (or make one). Returns the slot.

argtypedescription
asNewboolean

load(slot: string) → boolean

Load saved slot `slot` into the session (one undo step).

argtypedescription
slotstring

delete(slot: string) → boolean

Delete saved slot `slot`.

argtypedescription
slotstring

defaultSpot(t: string) → void

where a part goes when the palette adds it without the 3D view

argtypedescription
tstring

placeType(t: string, fromNav: boolean?) → void

argtypedescription
tstring
fromNavboolean?

setPaint(fn: (any) → void

argtypedescription
fn(any

numScrub(key: string, data: any) → void

argtypedescription
keystring
dataany

act(id: string, value: any?, fromNav: boolean?) → void

Run one garage action id (what every widget, key and pad press resolves to). `value` carries a field's value or a drag's data; `fromNav` is true for the keyboard/pad cursor.

argtypedescription
idstring
valueany?
fromNavboolean?

back( ) → boolean

Esc / pad B in the garage: blur a field → close the menu → cancel a placement → leave the pad view → close the stats sheet → clear the selection → (pressed twice) back to the title.

open(keep: boolean?) → void

Open the garage: the session opens on the player's corner build (kept as it is when `keep` and a session is open, e.g. back from a test drive).

argtypedescription
keepboolean?

flush( ) → void

Push the session's build to the player's corner now.

close( ) → void

Leave the garage: flush the build to the corner and remember it.

tick(dt: number) → void

Per-frame: push edits to the corner bot while it stands on the turntable (~4/s, never mid-drag) and age the toast.

argtypedescription
dtnumber

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

Showing up to 3 levels deep. Open a part to see what it holds further down.

23+items
▣
module · born here
❒asset
# game.rules BATTLEBOX's constants, rules and live match state, shared by every part of the game. `require("game.rules")`. - **Constants**: `TITLE`, `PLAYER` ("HAVOC"), `RIVAL` ("RIPTIDE"), `COLORS` palette, `MATCH_SECONDS` (180), `COUNTDOWN_SECONDS`, `KO_COUNT_SECONDS` (10), `IMMOBILE_SPEED`, `MAX_HEALTH` (100), `ARENA` (16 x 16 m box, wall height, camera inset), `STARTS` (start squares, yaw), `HAZARDS` (every floor saw, kill-saw slot, the screw pit and the four pulverizers, with damage footprints), `BOT_SPECS` (size, mass, drive, weapon RPM and damage). - **Rules**: `weaponDamage(attacker, rpm)` = maxHitDamage x (rpm/maxRpm)^2, zero below 20% spin; `weaponKnockback`; `hazardAt(x, z)`; `decide()` for the judges (more damage dealt wins, then more health, then RIPTIDE). - **State** (per peer, single-player vs the AI): `state()`, `bot(name)`, `opponent(name)`, `isLive()`; phases `free` / `title` / `countdown` / `fight` / `ko` / `decision`. - **Mutations**: `registerBot`, `setPhase`, `applyDamage(victim, amount, cause, attacker?)`, `reset()`. - **Events**: `on(event, fn)` returns an unsubscribe; `emit(event, payload)`. Events: phase, hit, hazard, damage, destroyed, ko, decision, reset, weapon, pulverize. - **Camera**: `kickCamera(0..1)`, `setShot("chase" | "faceoff" | "orbit", focus?)`, read by `game.ArenaCam`. - `formatClock(seconds)` -> "2:14". State lives in `modules.state()`, so it survives hot reloads. Owned by the plan step; slices read it and may ask for additions in `design/spec.md`.
▲ 0↑ born
▣
module · born here
❒asset
# editor.view BATTLEBOX's 3D build view, the garage's robot maker. It shows the open `editor.session` design on a build stand in front of the screw pit. It edits that design only through the session. It uses `bots.assembler` (`build`, then `updatePart` / `addPart` / `removePart` per change) when available, and simple primitive stand-ins otherwise. What it draws and does: - **Stand:** a floor grid at 1, 5 or 10 cm by the move snap, the centre line and mirror plane, X/Y/Z axes and the size-limit box (`Parts.BOUNDS`). - **Camera:** an orbit/pan/zoom camera, read by `game.ArenaCam`'s `build` shot. Presets are front, side, top, iso and back; `F` focuses the selection. - **Placement:** `beginPlace(type)` shows a ghost of the new part that snaps flush onto the face under the pointer (ray against the parts' oriented boxes). Wheels go axle-out, plates lie flat and weapons face outward. With mirror mode on, the ghost's mirror twin shows too. - **Selection:** click selects, Shift adds, and clicking empty space clears. Hover and selection get outlines. - **Gizmos:** move (axis arrows and plane handles), rotate (yaw, pitch and roll rings, snapped by the session) and scale (local axis handles honouring `sizeRule`). Each drag is one session drag, so it is one undo step. - **Overlays:** centre of mass, wheel ground contact, weapon strike zones and sweep circles, and problem (red) or warning (amber) parts from `stats.issues`. - **Input:** mouse, touch (tap, one-finger orbit, two-finger pinch and pan) and gamepad (stick orbit, trigger zoom, D-pad nudge, shoulder rotate). Shortcuts come from `editor.buildView`. The module header documents the whole API: `active`, `beginPlace`, `cancelPlace`, `placing`, `setTool`, `tool`, `setView`, `focus`, `hovered`, `hoveredHandle`, `dragging`, `setPointerBlocker`, `setPadEnabled`, `setOverlays`, `on`, `cameraPose`, `stats` and `toScreen`. Hosted by the `editor.BuildView` component, which `game.ArenaCam` spawns while phase is `garage`. The garage panels (`screens/`) call the API.
▲ 0↑ born
▣
module · born here
❒asset
# bots.parts The catalogue of every part a combat robot can be built from, and the maths every system shares to place them. - **Catalogue:** 26 part types in 7 categories: - Structure: base plate, frame rail, block, ballast. - Armour: plate, wedge, box, dome and cylinder shells, forks. - Drive: wheel, tank tread, caster. - Weapons: vertical and horizontal spinners, drum, flipper, hammer/axe, lifter, crusher, ram spike. - Power and control: battery, receiver/ESC. - Utility: self-righter. - Decor: name plate, status light. - **What each type defines:** its shape, size limits, a sizing rule, default material and settings, and paint role. Materials (aluminium, steel, titanium, AR500, Hardox, UHMW, polycarbonate) use real densities and damage behaviour; LiPo and LiFePO4 battery chemistries are included. - **Shared maths:** bot space, part transforms (yaw, pitch, roll), corners, bounds, distance to a part, and mirroring across the centre line. - **Per-part physics:** mass, hit points and armour from a part's size, material and settings, plus SoftBody dent parameters for armour. Used by `bots.design` (whole-bot physics), `editor.session`, the assembler, the builder screens and the damage system.
▲ 0↑ born
▣
module · born here
❒asset
# editor.session The bot being built in the garage, and every edit to it. It holds one live v2 design per peer and provides: - part operations: add, remove, set a field, translate, duplicate, mirror a part, unlink a twin, replace the whole design, and set the name, number or paint; - mirror symmetry with linked twins across the centre line; - snapping; - continuous drags recorded as a single undo step; - undo and redo (up to 100 steps); - selection; - change listeners; - a cached `bots.design` derive of the live design. Both the 3D build view (`editor/`) and the garage panels (`screens/`) edit the design only through this module, so every surface shares one history and one selection.
▲ 0↑ born
▣
module · born here
❒asset
# bots.design What a combat robot is, as data. Holds the parts catalogue the garage offers (chassis shapes, armour materials and thickness, weapons, drive, front attachments, self-righter, paint), the 250 lb heavyweight limit, the preset bots (HAVOC, RIPTIDE, MAULER, CATAPULT, JUDGEMENT, BULLDOZER), and `derive(design)`. `derive` turns a design into weight, drive speed and turn rate, weapon numbers, the SoftBody armour parameters, and 0–1 ratings for the garage's stat bars. `normalize` repairs any loaded table into a valid design; `encode`/`decode` save and load designs as JSON; `random` makes a legal random opponent. It spawns and draws nothing.
▲ 0↑ born
backing path · screens/garage.module

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.