cutscene
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
cutscene
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game.story.cutscene — scripted scenes for Amelia, written as plain Luau that yields: every step below waits until it is finished, so a scene reads top to bottom like a script. local C = require("game.story.cutscene") C.register("meetWren", function() C.focus("Wren") C.say("wren", "You're standing on my yarrow.", "smirk") local pick = C.ask("amelia", "Sorry! Um—", { "Apologise", "Apologise more" }) C.walk("Amelia", 2.0, -1.2, 2.5, "murmurwood") -- area-local coords local result = C.battle({ "gloomcap", "gloomcap" }) -- "win" | "lose" | "flee" C.joinParty("wren") end) C.play("meetWren") -- runs it in its own task; false if one is running C.isRunning() While a scene runs the story "holds" the player (Story.hold): the dialogue inputMap is live (group ui, suppresses player), Areas stops exits and random encounters, the menu stays shut, Talk prompts hide. Each scene emits Events "cutsceneStart"(id) / "cutsceneEnd"(id). The camera target and every temporary actor are restored / removed when the scene ends, error or not. Steps (call only from inside a scene): say(who, text, mood?) one line; waits for the player ask(who, text, replies) -> i a line ending in a reply menu lines(seq) a content.module-style sequence (lines, set, objective) endLines() fade the box away (and wait for it) walk(name, x, z, speed?, area?) slide an entity root there (Amelia animates) walkAsync(...) same, without waiting place(name, x, z, area?) snap there wait(seconds) focus(name) / focusAt(x, z, area?) / unfocus() DioramaCamera target swap fade(toBlack, seconds?, kind?) game.ui.fader ("black" | "vignette") setFlag(name, value?) / objective(text) / joinParty(id) / restoreParty() battle(pool, opts?) -> result Battle.start, yields until it ends travel(area, spawn?) Areas.travel, yields until arrived sfx(name) / music(track) / toast(text, icon?) actor(key, material, x, z, height, area?, opts?) -> entity a temporary sprite removeActor(key) / setActive(name, on)
origin(area: string?) → void
| arg | type | description |
|---|---|---|
| area | string? |
toWorld(x: number, z: number, area: string?) → void
| arg | type | description |
|---|---|---|
| x | number | |
| z | number | |
| area | string? |
find(name: string) → any
Named entity, cached; actors first so a scene can address its own sprites. "Root/Name" looks only under the area root `Root` (a stray same-named test entity elsewhere is never the one moved).
| arg | type | description |
|---|---|---|
| name | string |
camera( ) → any
warnf(msg: string) → void
| arg | type | description |
|---|---|---|
| msg | string |
register(id: string, fn: (...any) → void
| arg | type | description |
|---|---|---|
| id | string | |
| fn | (...any |
has(id: string) → boolean
| arg | type | description |
|---|---|---|
| id | string |
isRunning( ) → boolean
current( ) → string
takeInput( ) → void
giveInput( ) → void
cleanup( ) → void
run(id: string, fn: (...any) → void
Run `fn` as the scene `id` (registered scenes go through M.play).
| arg | type | description |
|---|---|---|
| id | string | |
| fn | (...any |
play(id: string, ...: any) → boolean
| arg | type | description |
|---|---|---|
| id | string | |
| ... | any |
abort( ) → void
Emergency stop for tests: drops the hold, input, camera and actors.
say(who: string, body: string, mood: string?) → void
| arg | type | description |
|---|---|---|
| who | string | |
| body | string | |
| mood | string? |
ask(who: string, body: string, replies: { string }, mood: string?) → number
| arg | type | description |
|---|---|---|
| who | string | |
| body | string | |
| replies | { string } | |
| mood | string? |
lines(seq: { any }) → void
A content.module-style sequence: lines, replies, set/unset/objective nodes.
| arg | type | description |
|---|---|---|
| seq | { any } |
endLines( ) → void
ameliaFrames(dir: string) → void
| arg | type | description |
|---|---|---|
| dir | string |
setAmeliaFrame(dir: string, i: number) → void
| arg | type | description |
|---|---|---|
| dir | string | |
| i | number |
walkNow(name: string, x: number, z: number, speed: number?, area: string?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| x | number | |
| z | number | |
| speed | number? | |
| area | string? |
walk(name: string, x: number, z: number, speed: number?, area: string?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| x | number | |
| z | number | |
| speed | number? | |
| area | string? |
walkAsync(name: string, x: number, z: number, speed: number?, area: string?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| x | number | |
| z | number | |
| speed | number? | |
| area | string? |
place(name: string, x: number, z: number, area: string?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| x | number | |
| z | number | |
| area | string? |
face(dir: string) → void
Turn Amelia toward "n" | "s" | "e" | "w".
| arg | type | description |
|---|---|---|
| dir | string |
wait(seconds: number) → void
| arg | type | description |
|---|---|---|
| seconds | number |
focus(name: string) → void
| arg | type | description |
|---|---|---|
| name | string |
focusAt(x: number, z: number, area: string?) → void
| arg | type | description |
|---|---|---|
| x | number | |
| z | number | |
| area | string? |
unfocus( ) → void
fade(toBlack: boolean, seconds: number?, kind: string?) → void
| arg | type | description |
|---|---|---|
| toBlack | boolean | |
| seconds | number? | |
| kind | string? |
setFlag(name: string, value: any?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| value | any? |
objective(text: string?) → void
| arg | type | description |
|---|---|---|
| text | string? |
joinParty(id: string) → void
The HUD toasts "<Name> joined the party!" itself on "partyChanged".
| arg | type | description |
|---|---|---|
| id | string |
restoreParty( ) → void
Everyone back to full HP / SP (keeps levels and exp).
battle(pool: { string }, opts: any?) → string
| arg | type | description |
|---|---|---|
| pool | { string } | |
| opts | any? |
travel(area: string, spawn: string?) → void
| arg | type | description |
|---|---|---|
| area | string | |
| spawn | string? |
sfx(name: string) → void
| arg | type | description |
|---|---|---|
| name | string |
music(track: string) → void
| arg | type | description |
|---|---|---|
| track | string |
toast(msg: string, icon: string?) → void
| arg | type | description |
|---|---|---|
| msg | string | |
| icon | string? |
actor(key: string, material: any, x: number, z: number, height: number, area: string?, opts: any?) → any
| arg | type | description |
|---|---|---|
| key | string | |
| material | any | |
| x | number | |
| z | number | |
| height | number | |
| area | string? | |
| opts | any? |
removeActor(key: string) → void
| arg | type | description |
|---|---|---|
| key | string |
vanish(key: string, seconds: number?) → void
Thin the actor's card down to nothing over `seconds` (a vanishing).
| arg | type | description |
|---|---|---|
| key | string | |
| seconds | number? |
setActive(name: string, on: boolean) → void
| arg | type | description |
|---|---|---|
| name | string | |
| on | boolean |
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.