36. Call dialogue from scripts and visual nodes
extends PCAScriptBasefunc 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.
| Entry route | Remember |
|---|---|
| Talk verb | Attach the Start Dialogue action to the correct scene character. |
| GUI button | Use a real Click event/action, not only a button label. |
| Visual graph | Connect its flow to Start Dialogue. |
| Script | Use the correct dialogue ID and await only when later work depends on completion. |
| Cutscene | Decide 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.
