Mistwood
A component script.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2Mistwood — the single world-component that owns the whole game: state machine (menu / playing / paused / dead / win), all zui screens (menus + diegetic HUD + fear vignette), every mechanic (clock, FEAR, battery, stamina, flashlight), the Pale Watcher AI, whisper-wisps, pickups, audio, and progression persistence. Mounted by scenes.main/entrypoint.luau on a temporary GameManager entity. Gameplay ticks in update(dt) (play mode); menus also refresh in editorUpdate(dt) so the title screen is visible while authoring.
safe(fn: ?, ...: ?) → void
safe fire-and-forget call: runs fn, swallows + logs failures.
| arg | type | description |
|---|---|---|
| fn | ? | |
| ... | ? |
clamp(v: ?, lo: ?, hi: ?) → void
| arg | type | description |
|---|---|---|
| v | ? | |
| lo | ? | |
| hi | ? |
dist2(ax: ?, az: ?, bx: ?, bz: ?) → void
| arg | type | description |
|---|---|---|
| ax | ? | |
| az | ? | |
| bx | ? | |
| bz | ? |
avatarId( ) → void
avatarPos( ) → void
cameraEnt( ) → void
audioUrl(name: ?) → void
Audio goes through the mistwood.audio director; these stay as thin local aliases so the call sites below read the same. Volumes are pushed to the director whenever settings change (see awake + the volume callbacks).
| arg | type | description |
|---|---|---|
| name | ? |
audioExists(name: ?) → void
| arg | type | description |
|---|---|---|
| name | ? |
sfx(name: ?, opts: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| opts | ? |
loopAudio(name: ?, volume: ?, channel: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| volume | ? | |
| channel | ? |
setLoopVolume(id: ?, v: ?) → void
| arg | type | description |
|---|---|---|
| id | ? | |
| v | ? |
loadProgress( ) → void
saveProgress( ) → void
noteCount( ) → void
ensureFlashlight( ) → void
setFlashlight(on: ?) → void
| arg | type | description |
|---|---|---|
| on | ? |
updateFlashlight( ) → void
meshEnt(name: ?, model: ?, material: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| model | ? | |
| material | ? |
clearActors( ) → void
spawnWatcher( ) → void
spawnWisp(i: ?, x: ?, z: ?) → void
| arg | type | description |
|---|---|---|
| i | ? | |
| x | ? | |
| z | ? |
spawnPickup(i: ?, kind: ?, x: ?, z: ?, noteId: ?) → void
| arg | type | description |
|---|---|---|
| i | ? | |
| kind | ? | |
| x | ? | |
| z | ? | |
| noteId | ? |
buildActors( ) → void
add(kind: ?, x: ?, z: ?, noteId: ?) → void
| arg | type | description |
|---|---|---|
| kind | ? | |
| x | ? | |
| z | ? | |
| noteId | ? |
ensureVignette( ) → void
setVignette(amt: ?) → void
| arg | type | description |
|---|---|---|
| amt | ? |
setupCamera( ) → void
Wire the engine-spawned first-person camera to the local avatar. The first-person controller seeds its look pitch from the camera's rotation once, on its first frame. In the editor the camera inherits the fly-cam's orientation (often pitched at the sky), so re-seat it deterministically: take over the controller's engine-bound target, remove it and level the camera THIS frame, then re-add a fresh controller a couple frames later — once the level rotation has applied with no controller overriding it, the re-added controller seeds looking at the horizon.
processCamReseed( ) → void
Complete a pending re-seed: once the level rotation has settled (no controller writing over it), add a fresh first-person controller.
startRun(difficulty: ?) → void
| arg | type | description |
|---|---|---|
| difficulty | ? |
endRun(win: ?, reason: ?) → void
| arg | type | description |
|---|---|---|
| win | ? | |
| reason | ? |
toMenu( ) → void
btn(text: ?, id: ?, opts: ?) → void
| arg | type | description |
|---|---|---|
| text | ? | |
| id | ? | |
| opts | ? |
label(text: ?, size: ?, color: ?, extra: ?) → void
| arg | type | description |
|---|---|---|
| text | ? | |
| size | ? | |
| color | ? | |
| extra | ? |
slider(id: ?, value: ?, lo: ?, hi: ?) → void
| arg | type | description |
|---|---|---|
| id | ? | |
| value | ? | |
| lo | ? | |
| hi | ? |
toggleRow(text: ?, id: ?, val: ?) → void
| arg | type | description |
|---|---|---|
| text | ? | |
| id | ? | |
| val | ? |
settingRow(text: ?, node: ?) → void
| arg | type | description |
|---|---|---|
| text | ? | |
| node | ? |
menuTree( ) → void
clockString( ) → void
hudTree( ) → void
pauseTree( ) → void
overlayTree( ) → void
refreshScreens( ) → void
nearestCover(px: ?, pz: ?) → void
| arg | type | description |
|---|---|---|
| px | ? | |
| pz | ? |
setSubtitle(t: ?, dur: ?) → void
| arg | type | description |
|---|---|---|
| t | ? | |
| dur | ? |
tryPickup( ) → void
updateWatcher(dt: ?, px: ?, pz: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? | |
| px | ? | |
| pz | ? |
updateWisps(dt: ?, px: ?, pz: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? | |
| px | ? | |
| pz | ? |
tickGameplay(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
handleEdges( ) → void
awake( ) → void
start( ) → void
commonTick(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
editorUpdate(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
onDestroy( ) → void
status( ) → void
Diagnostic snapshot of the live run (used to validate gameplay).
setClock(v: ?) → void
Diagnostic: jump the night clock (used to validate the dawn/win path).
| arg | type | description |
|---|---|---|
| v | ? |
onCallback(id: ?, data: ?) → void
| arg | type | description |
|---|---|---|
| id | ? | |
| data | ? |
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.