Director
One-paragraph description of what this component does and what it attaches to. Mention any required sibling components (e.g. Model, Transform).
Director
One-paragraph description of what this component does and what it attaches to. Mention any required sibling components (e.g. Model, Transform).
Public fields
exampleNumber: number— what it controls, units, valid range.exampleString: string— what it controls.exampleBool: boolean— what it controls.
Methods
:methodName(arg)— what it does and when to call it.
Lifecycle
awake()— same-frame attach hook. What initial state this component sets up.start()— first-frame-after-awake hook. Cross-component setup that needs the other components on the entity to have finishedawake.update(dt)— per-frame while the gameplay clock runs. What this component does each tick.onDestroy()— cleanup performed on detach / entity despawn.
See man components for the full hook list (onEnable, fixedUpdate,
onPropertyChanged, etc.) and the timing details.
Usage
entity(id).component.add("Director", { exampleNumber = 1.0 })
entity(id).component.get("Director"):methodName("foo")
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2Director — the IN THE WIRE story slice. Runs the whole Prologue "BOOT" as one state machine (spec.md §Prologue flow): title -> coldopen -> grid -> call1 -> street -> battle_awakening -> teddy -> arcade -> blank -> hook -> end and owns every story screen: the title (title_screen.png), the cold-open terminal, the HUD location/clock line, the [E] interact prompt, the dialogue box (styles normal / phone / crayon / system, typewriter text, choices), chapter cards, the Blank Room save prompt and GAME OVER. Provides Wire "story": say(lines, opts) / choose(prompt, options) / card(title, subtitle, seconds) / state() (+ hud, objective). Emits Wire "beat"(name) whenever a beat starts. Every other slice is reached via Wire.use(...) at the moment of use, and its absence is survived. Input: game.story.story_explore (interact = E) is live all game; game.story.story_dialog (confirm / menuUp / menuDown) is live only while the story holds the input lock, and it stands the "player" group down so the body cannot walk while somebody is talking.
fresh( ) → void
vec(p: any) → void
Small helpers
| arg | type | description |
|---|---|---|
| p | any |
flat(a: { number }?, b: { number }?) → number
| arg | type | description |
|---|---|---|
| a | { number }? | |
| b | { number }? |
usub(s: string, n: number) → string
| arg | type | description |
|---|---|---|
| s | string | |
| n | number |
ulen(s: string) → number
| arg | type | description |
|---|---|---|
| s | string |
svc(name: string, fn: string, ...: ?) → any
Call a method on another slice's API; nil (never an error) when the slice or the method is missing or fails.
| arg | type | description |
|---|---|---|
| name | string | |
| fn | string | |
| ... | ? |
sfx(name: string, pos: any?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| pos | any? |
pt(name: string) → void
| arg | type | description |
|---|---|---|
| name | string |
avatar( ) → any
playerPos( ) → void
setPlayerPos(p: { number }) → void
| arg | type | description |
|---|---|---|
| p | { number } |
castPos(name: string) → void
| arg | type | description |
|---|---|---|
| name | string |
markAll( ) → void
activateExplore( ) → void
setDialogMap(on: boolean) → void
| arg | type | description |
|---|---|---|
| on | boolean |
lock(tag: string, on: boolean) → void
| arg | type | description |
|---|---|---|
| tag | string | |
| on | boolean |
W( ) → number return
UI tree helpers
Hh( ) → number return
L(text: string, style: any, props: any?, id: string?) → any
| arg | type | description |
|---|---|---|
| text | string | |
| style | any | |
| props | any? | |
| id | string? |
V(style: any, children: { any }?, id: string?) → any
| arg | type | description |
|---|---|---|
| style | any | |
| children | { any }? | |
| id | string? |
Hz(style: any, children: { any }?, id: string?) → any
| arg | type | description |
|---|---|---|
| style | any | |
| children | { any }? | |
| id | string? |
Svg(svg: string, style: any, id: string?) → any
| arg | type | description |
|---|---|---|
| svg | string | |
| style | any | |
| id | string? |
abs(l: number, t: number, w: number?, h: number?) → any
| arg | type | description |
|---|---|---|
| l | number | |
| t | number | |
| w | number? | |
| h | number? |
blink(period: number?) → any
| arg | type | description |
|---|---|---|
| period | number? |
fadeIn(dur: number?, delay: number?, from: string?) → any
| arg | type | description |
|---|---|---|
| dur | number? | |
| delay | number? | |
| from | string? |
cursorBlock(h: number, color: string?) → any
| arg | type | description |
|---|---|---|
| h | number | |
| color | string? |
lcg(seed: number) → void
deterministic jitter for hand-drawn SVG strokes
| arg | type | description |
|---|---|---|
| seed | number |
vectorText(text: string, color: string, strokeW: number) → void
Thin glowing cyan vector lettering, `text` in capitals.
| arg | type | description |
|---|---|---|
| text | string | |
| color | string | |
| strokeW | number |
crayonSvg(w: number, h: number, x0: number, y0: number, x1: number, y1: number, seed: number, thick: number?) → string
A waxy red crayon stroke from (x0,y0) to (x1,y1) inside a w x h viewBox.
| arg | type | description |
|---|---|---|
| w | number | |
| h | number | |
| x0 | number | |
| y0 | number | |
| x1 | number | |
| y1 | number | |
| seed | number | |
| thick | number? |
loop(cx: number, cy: number, r: number) → void
| arg | type | description |
|---|---|---|
| cx | number | |
| cy | number | |
| r | number |
figureSvg(progress: number) → string
| arg | type | description |
|---|---|---|
| progress | number |
fxTree( ) → any
titleTree( ) → any
hudTree( ) → any
whoColor(who: string?) → string
| arg | type | description |
|---|---|---|
| who | string? |
choiceRows(D: any, style: string) → any
| arg | type | description |
|---|---|---|
| D | any | |
| style | string |
dialogTree( ) → any
cardTree( ) → any
refresh( ) → void
onConfirm( ) → void
Dialogue + menus
onMove(dir: number) → void
| arg | type | description |
|---|---|---|
| dir | number |
canYield( ) → boolean
say(lines: { any }, opts: any?) → any
say(lines, opts): typewriter dialogue; yields until the last line is confirmed.
| arg | type | description |
|---|---|---|
| lines | { any } | |
| opts | any? |
choose(prompt: any, options: { string }, opts: any?) → number
| arg | type | description |
|---|---|---|
| prompt | any | |
| options | { string } | |
| opts | any? |
menu(kind: string, options: { string }, enabled: { boolean }?) → number
full-screen menu (title / game over); yields until picked
| arg | type | description |
|---|---|---|
| kind | string | |
| options | { string } | |
| enabled | { boolean }? |
card(title: string?, subtitle: string?, seconds: number?, extra: any?) → void
| arg | type | description |
|---|---|---|
| title | string? | |
| subtitle | string? | |
| seconds | number? | |
| extra | any? |
setHud(beat: string) → void
| arg | type | description |
|---|---|---|
| beat | string |
objective(text: string?) → void
| arg | type | description |
|---|---|---|
| text | string? |
setBeat(name: string) → void
| arg | type | description |
|---|---|---|
| name | string |
waitInteract(where: () → void
Waiting on the player Show [E] <label> while the player is within `radius` of where(); return when E is pressed there.
| arg | type | description |
|---|---|---|
| where | ( |
waitNear(where: () → void
| arg | type | description |
|---|---|---|
| where | ( |
waitUntil(pred: () → void
| arg | type | description |
|---|---|---|
| pred | ( |
spawnTitle( ) → void
despawnTitle( ) → void
beatTitle( ) → void
Beats
beatColdOpen( ) → void
phonePoint( ) → void
beatGrid( ) → void
beatCall1( ) → void
beatStreet( ) → void
runBattle( ) → boolean
gameOver( ) → number
beatBattle( ) → string
teddyPoint( ) → void
beatTeddy( ) → void
beatArcade( ) → void
deskPoint( ) → void
beatBlank( ) → void
hookPhone( ) → void
beatHook( ) → void
beatEnd( ) → void
placeFor(beat: string) → void
teleport targets when a run starts mid-way (CONTINUE / startBeat)
| arg | type | description |
|---|---|---|
| beat | string |
runFrom(startBeat: string) → void
| arg | type | description |
|---|---|---|
| startBeat | string |
say(lines: any, opts: any?) → void
| arg | type | description |
|---|---|---|
| lines | any | |
| opts | any? |
choose(prompt: any, options: { string }, opts: any?) → void
| arg | type | description |
|---|---|---|
| prompt | any | |
| options | { string } | |
| opts | any? |
card(title: string?, subtitle: string?, seconds: number?) → void
| arg | type | description |
|---|---|---|
| title | string? | |
| subtitle | string? | |
| seconds | number? |
state( ) → void
hud(location: string?, clock: string?) → void
| arg | type | description |
|---|---|---|
| location | string? | |
| clock | string? |
objective(text: string?) → void
| arg | type | description |
|---|---|---|
| text | string? |
busy( ) → void
teardown( ) → void
Lifecycle
awake( ) → void
start( ) → void
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
onCallback(id: string, _data: any) → void
| arg | type | description |
|---|---|---|
| id | string | |
| _data | any |
onDestroy( ) → void
status( ) → any
Snapshot of the story state machine for tests: current beat, HUD line, prompt, open dialogue/menu/card.
examples
entity.find("Director").component.get("Director"):status()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.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ 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".
Scoped to this part · feeds back into the world's score.