Skip to reading
The Dialogue Designer

36. Call dialogue from scripts and visual nodes

Edition 0.86.3.4

Build branching conversations with choices, conditions, actions, timed responses, voices, portraits and custom windows.

Download PDFView PDF page
Code example
extends PCAScriptBase
Code example
func run() -> void:
    await StartDialogue({"dialogueId":"archive_chat"})

This starts the same dialogue and waits for it to finish before the script continues. Use the normal Start Dialogue action in a visual graph when no custom script is needed.

Run Script actions can call a project script that chooses which conversation to open. Call Script Function is useful when you expose a function with parameters, such as a reusable conversation launcher.

Source table from 36. Call dialogue from scripts and visual nodes, page 40
Entry routeRemember
Talk verbAttach the Start Dialogue action to the correct scene character.
GUI buttonUse a real Click event/action, not only a button label.
Visual graphConnect its flow to Start Dialogue.
ScriptUse the correct dialogue ID and await only when later work depends on completion.
CutsceneDecide whether the cutscene should wait, and restore its intended presentation afterward.

Do not start the same conversation again from its own OnDialogueStarted event. That creates nested starts instead of a single entry. Keep event hooks focused on observation or deliberate state changes.

Page 40 of 77Permalink
Go to page