Skip to reading
Lua Scripting

Talk, animate and stage a reveal

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

LESSON 15

Make a spoken clue finish before a camera moves and a cutscene takes over.

Code example
local Script = {}
Code example
function Script.run(context)
    await(Say({ speakerId = "elias", text = "Listen to the last bell.",
                waitForContinue = true, typewriter = true }))
    await(ActivateCamera({ cameraId = "wide", duration = 0.6,
                           wait = true }))
    await(PlaySound({ assetId = "chime" }))
    await(StartCutscene({ cutsceneId = "archive_reveal" }))
    return true
end
Code example
return Script

Create or substitute an NPC, a camera in the current room, an audio asset and a cutscene. Attach

the record to the NPC's Talk interaction. The speech waits for advance. Camera blending finishes

before the sound starts. Awaiting an action waits for that action's implementation. Audio playback

may continue after the start action completes.

For branching conversation, replace the speech with await(StartDialogue({ dialogueId =

"archive_intro" })). Author choices and exits in the Dialogue Designer. Where the voice line is

localized, use the speech action's voiceKey or voiceAssetId with the character's configured portrait

and lip-sync settings.

Page 33 of 133Permalink
Go to page