Dialogue Singleton Reference

The Dialogue autoload is automatically set by the plugin when "enable helpers" is set in Project Settings. It allows you to start, stop and listen to dialogues from anywhere, using the "Dialogue" singleton.

Methods

Return Method
void start_dialogue(path: String, block: String = "", speakers: Dictionary = {})
void load_dialogue(path: String, block: String = "", speakers: Dictionary = {})
void start()
Variant set_variable(var_name: String, value: Variant)
Variant get_variable(var_name: String)
void on_external_variable_fetch(callback: Callable)
void on_external_variable_update(callback: Callable)

Signals

dialogue_started(dialogue_path: String, block: String)

Emitted when a dialogue started.


dialogue_ended(dialogue_path: String, block: String)

Emitted when a dialogue ended.


variable_changed(variable_name: String, value: Variant, old_value: Variant)

Emitted when a dialogue variable changed.


event_triggered(event_name: String, parameters: Array)

Emitted when a dialogue event was triggered.


speaker_changed(current_speaker: String, previous_speaker: String)

Emitted when the current line has a different speaker from the previous one.


Method descriptions

void start_dialogue(path: String, block: String = "", speakers: Dictionary = {})

Start a dialogue. This will create the dialogue bubble based on the configuration set in the dialogue config node.


void load_dialogue(path: String, block: String = "", speakers: Dictionary = {})

Setup dialogue but does not execute it. You should call start() when ready to start dialogue.
Useful for when initial setup is required before starting.


void start()

Start pre-loaded dialogue


Variant set_variable(var_name: String, value: Variant)

Set variable to current running dialogue


Variant get_variable(var_name: String)

Get variable from current running dialogue


void on_external_variable_fetch(callback: Callable)

Set callback to be used when requesting external variables. This callback should return the value for the requested variable, which will be used in the dialogue.


void on_external_variable_update(callback: Callable)

Set callback to be used when an external variable is updated in the dialogue