- Create
DialogueData
resource and write a dialogue. - Create script, which extends
DialogueInterpreter
, and implement your custom_ask
and_say
methods. - Call
run_block()
method of interpreter with dialogue block key.
Example of dialogue resource is dialogue1.tres
, and custom interpeter is dialogue_scene.gd
.
Every line without special symbols in the start considered as a phrase.
It has two parts - name before :
and phrase text afterwards. Can have multiline text, if has no characters after :
.
If for some weird reason your phrase line must start with special symbol (below) - escape it with '\', i.e. '\$'.
To start phrase line with '\', use '\\'.
Interpolate any code in a phrase between curly braces. It will use the same runner as expression line ($
).
Used for defining start of the dialogue block. Can be referenced later by other instructions. Everything after '#' till end of line will be the name of dialogue block. Block ends when there will be another dialogue block or the end of file.
Used for executing arbitrary code. As default, will be executed as Godot Expression in context of dialogue interpreter. Typically it is a method call.
Text with followed options to choose from.
Options to choose from. Written in form of =<block_name> Text
and after selecting
one of them interpreter will jump to block specified by block name.
Can have visibility condition in form of =<block_name>code> Text
.
If all choices are not visible, question block is skipped.
If no choice is choosen, will proceed to next line without jump.
Code what will be matched with choices.
Options to match switch value. Written in form of =<block_name> code
and after finding first
choice which code value is equals switch code value, interpreter will jump to block specified by block name.
Can have guard condition in form of =<block_name>guard_code> code
.
If all choices are excluded, switch block is skipped.
If no choice matches switch code, will proceed to next line without jump.
Used for jumping to another dialogue block unconditionally.
Oneline comment. Stripped from output.
TODO
TODO
Used for saying phrase. Not implemented in base interpreter.
Used for asking question. Must return index of choosen choice. Can return -1 if no choice is choosen. Not implemented in base interpreter.
Used for executing code line. Executes code as awaited godot expression in context of interpreter by default.
Used for interpolating text and names in phrases, also goto / question / switch targets. Interpolate text in curly braces ("{}") as sync godot expressions by default.
- Multiline phrases
- Options choose
- Branching
- If / switch logic
- Variable interpolation
- Phrase syntax (effects, highlight, font, etc)
- Escape special characters in start of string if it is a phrase
- Node editor
- Conditional choice options
- Expression in text of goto