smoothstep(a: number, b: number, x: number) → number
The volcano's shape. This is the ONE definition of where the ground is.
Terrain generation, pylon placement, hazard targeting and spawn points all
call it, so nothing can disagree about what is solid.
| arg | type | description |
|---|
| a | number | |
| b | number | |
| x | number | |
groundHeight(x: number, z: number) → number
Analytic surface height of the volcano at a world XZ position.
| arg | type | description |
|---|
| x | number | |
| z | number | |
groundNormal(x: number, z: number) → void
Surface normal, from finite differences on groundHeight.
| arg | type | description |
|---|
| x | number | |
| z | number | |
pylonSites( ) → void
Fixed world layout. Deterministic, so every slice places against the same
coordinates without reading the scene file.
The survey pylons, evenly spaced around the crown, sitting ON the rim.
Returns an array of { index, name, x, y, z }.
spawnPoint( ) → void
Where a joining player starts: on the flank, below the crown, facing uphill.
localAvatar( ) → any
The body entity of the player THIS client controls, or nil.
Re-resolve it every time you need it — never stash it. In edit mode, and
for the first frames of play before the prototype has been cloned, it is
nil, and every caller must tolerate that.
distanceToPlayer(x: number, z: number) → number
Horizontal distance from a world XZ to the local avatar, or nil if there
is no avatar yet.
| arg | type | description |
|---|
| x | number | |
| z | number | |
progress( ) → number
Eruption progress, 0..1. The single number the look and the HUD ride on.
lavaHeightAt(p: number) → number
Lava surface height for a given progress. The director applies it to state.
| arg | type | description |
|---|
| p | number | |
resetState( ) → void
Reset every field to the start of a run.
on(event: string, fn: (any) → void
Subscribe. Returns an unsubscribe function — call it in your onDestroy.
| arg | type | description |
|---|
| event | string | |
| fn | (any | |
emit(event: string, payload: any?) → void
Publish. A handler that errors is reported and skipped; the rest still run.
| arg | type | description |
|---|
| event | string | |
| payload | any? | |
clearHandlers( ) → void
Drop every subscription. Called by the director when it reloads, so a
hot-reloaded component does not leave a dead handler behind.