Skip to reading
PCA Script Programming

37. Speech, portraits and typewriter messages

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

Speech, narrator messages and a branching dialogue are different jobs. say is a convenient spoken line; show_message presents a message; start_dialogue runs a graph authored in the Dialogue Designer. A portrait and its mouth animation come from the speaker’s configured portrait/lip-sync setup.

Code example
function run()
    let line = {}
    line["text"] = "Someone has been here before us."
    line["duration"] = 2
    line["typewriter"] = true
    line["typewriterSpeed"] = 35
    line["typewriterSound"] = "default"
    show_message(line)
end

For silent typing choose none. For an imported typing sound choose custom and set

typewriterSoundAssetId to the audio asset ID. Duration and continuation settings still control the surrounding presentation. Test a short line and a long line so the player is not forced to wait after the text has finished.

For character speech, use the Say action’s speaker/portrait/voice fields shown in the reference. A plain text string does not automatically create voice audio, visemes or a portrait mouth mapping. Configure the character and portrait first, then test the same speech route used by the game.

Keep translated player-facing text in the game’s translation workflow. format() only assembles a string; it is not a request to translate it or to look up an arbitrary new translation key.

Page 45 of 357Permalink
Go to page