Soundtrack
One-paragraph description of what this component does and what it attaches to. Mention any required sibling components (e.g. Model, Transform).
Soundtrack
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("Soundtrack", { exampleNumber = 1.0 })
entity(id).component.get("Soundtrack"):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/v2game.audio.Soundtrack — the sound of IN THE WIRE. Lives on Anchors/Audio. Provides the "audio" service (see design/spec.md): audio.music(track) crossfading music deck "title" | "grid" | "street" | "dread" | "battle" | "awakening" | "blank" | "none" audio.sfx(name, position?) one-shot effects (spatial when a position is given) audio.voice(id) Operator lines (game/audio/voice/<id>.soundClip) audio.ring(on, position?) looping phone ring (stopped by sfx "phone_pickup") audio.current() the track that is playing now Missing names are silent, never errors. It also listens to Wire "beat" and "battleEnded" itself and picks the music, so the game sounds right even if nobody calls music(). Clips: game/audio/music/*.soundClip, game/audio/sfx/*.soundClip, game/audio/voice/*.soundClip (all generated with audio_gen).
freshState( ) → void
clipRef(id: string) → any
| arg | type | description |
|---|---|---|
| id | string |
clipSeconds(ref: any) → number
| arg | type | description |
|---|---|---|
| ref | any |
findChild(name: string) → any
| arg | type | description |
|---|---|---|
| name | string |
makeSource(name: string, opts: any) → any
| arg | type | description |
|---|---|---|
| name | string | |
| opts | any |
ensure( ) → boolean
applyDeckVolume(d: any) → void
| arg | type | description |
|---|---|---|
| d | any |
music(track: string?) → void
Music
| arg | type | description |
|---|---|---|
| track | string? |
sfx(name: string, position: any?) → void
SFX
| arg | type | description |
|---|---|---|
| name | string | |
| position | any? |
ring(on: boolean, position: any?, seconds: number?) → void
Looping phone ring at a position (the payphone, the arcade wall phone).
| arg | type | description |
|---|---|---|
| on | boolean | |
| position | any? | |
| seconds | number? |
voice(id: string) → void
Voice
| arg | type | description |
|---|---|---|
| id | string |
playerBodyPos( ) → void
Graphite footsteps: a pencil scratch every STEP_STRIDE metres the local player's body walks (horizontal distance; teleports reset the count).
playFootstep( ) → void
stepFootsteps(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
smearEntity( ) → any
The Smear's ooze: one looping spatial source riding CastRoot/smear while it is shown; it fades out when the Smear is hidden or gone.
smearShown(e: any) → boolean
| arg | type | description |
|---|---|---|
| e | any |
stepOoze(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
onBeat(name: any) → void
Story hooks
| arg | type | description |
|---|---|---|
| name | any |
onBattleEnded(result: any) → void
| arg | type | description |
|---|---|---|
| result | any |
music(track: string?) → void
| arg | type | description |
|---|---|---|
| track | string? |
sfx(name: string, position: any?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| position | any? |
voice(id: string) → void
| arg | type | description |
|---|---|---|
| id | string |
ring(on: boolean, position: any?, seconds: number?) → void
| arg | type | description |
|---|---|---|
| on | boolean | |
| position | any? | |
| seconds | number? |
current( ) → void
tracks( ) → void
sfxNames( ) → void
sfx(name: string, position: any?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| position | any? |
unsubscribeAll( ) → void
Lifecycle
awake( ) → void
start( ) → void
step(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
onDestroy( ) → void
playMusic(track: string) → void
Play a music track by name, crossfading from the current one.
| arg | type | description |
|---|---|---|
| track | string | One of title, grid, street, dread, battle, awakening, blank, none. |
examples
entity.find("Audio").component.get("game.audio.Soundtrack"):playMusic("street")playSfx(name: string) → void
Play a named sound effect once.
| arg | type | description |
|---|---|---|
| name | string | An sfx name from design/spec.md. |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
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.