ClydeDialogue Class Reference

This plugin exposes the interpreter as ClydeDialogue.

The interpreter is simple, yet powerfull. The plugin also provide some helpers for quick start. However, I recommend reading about the core interpreter first, to understand how things work.

For details about the language, check the language reference page.

Methods

Return Method
void load_dialogue(file_name: String, block: String = "")
void start(block_name: String = "")
Dictionary get_content()
void choose(option_index: int)
Variant set_variable(name: String, value: Variant)
Variant get_variable(name: String)
void on_external_variable_fetch(callback: Callable)
void on_external_variable_update(callback: Callable)
Dictionary get_data()
void load_data(data: Dictionary)
void clear_data()
void configure(options: Dictionary)
bool has_block(block_name: String)

Signals

variable_changed(variable_name: String, value; Variant, previous_vale: Variant)

Emitted when a variable change.


event_triggered(event_name: String, parameters: Array)

Emitted when a dialogue event is triggered.


Method descriptions

void load_dialogue(file_name: String, block: String = "")

Load a dialogue file.


func start(block_name: String = "") -> void

Start or restart dialogue. Data is not cleaned.


func get_content() -> Dictionary

Get next dialogue content. The content may be a line, options or end.


func choose(option_index: int) -> void

Choose one of the available options.


func set_variable(name: String, value: Variant) -> Variant

Set variable to be used in the dialogue


func get_variable(name: String) -> Variant

Get current value of a variable inside the dialogue.


func on_external_variable_fetch(callback: Callable) -> void

Set callback to be used when requesting external variables.


func on_external_variable_update(callback: Callable) -> void

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


func get_data(): Dictionary

Return all variables and internal variables. Useful for persisting the dialogue's internal data, such as options already choosen and random variations states.


func load_data(data: Dictionary) -> void

Load internal data retrieved before via get_data.


func clear_data() -> void

Clear dialogue state and related data.


func configure(options: Dictionary) -> void

Set optional settings for current interpreter.


func has_block(block_name: String) -> bool

Verifies if current dialogue contains block with given name.