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
Emitted when a variable change.
Emitted when a dialogue event is triggered.
Method descriptions
Load a dialogue file.
- file_nameis the path to the dialogue file.i.e.
- my_dialogue,- res://my_dialogue.clyde,- res://my_dialogue.json.- block: block name to execute.
Start or restart dialogue. Data is not cleaned.
- block_name: optional block to run. If empty, uses current one.
Get next dialogue content. The content may be a line, options or end.
Choose one of the available options.
- option_index: index starting in 0.
Set variable to be used in the dialogue
- name: variable name
- value: variable value
Get current value of a variable inside the dialogue.
- name: variable name
Set callback to be used when requesting external variables.
- callback: Signature- function (var_name: String)
Set callback to be used when an external variable is updated in the dialogue
- callback: Signature- function (var_name: String, var_value: Variant)
Return all variables and internal variables. Useful for persisting the dialogue's internal data, such as options already choosen and random variations states.
Load internal data retrieved before via get_data.
Clear dialogue state and related data.
Set optional settings for current interpreter.
- Options:
 include_hidden_options: (boolean, defaultfalse): Conditional options which checks result in false, will still be included in the option list.
Verifies if current dialogue contains block with given name.