Repository navigation
Using Event Signals
SnekOfSpice edited this page May 15, 2024
·
1 revision
The class DiisisParserEvents (available in the internal documentation with F1) provides hooks for you to react to in your game. It sends out events whenever something notable happens in the LineReader. Have a look through the documentation and find the signals you need!
It is available as an autoload to your Project as ParserEvents.
If you had a character scene that needs to display varying emotions, a script snipped could look like this:
@export var character_name = ""
func _ready() -> void:
ParserEvents.dialog_line_args_passed.connect(on_dialog_line_args_passed)
func on_dialog_line_args_passed(actor_name: String, args: Dictionary):
if args.has(str(character_name, "-emotion")):
var emotion_to_display : String = args.get(str(character_name, "-emotion"))
set_emotion(emotion_to_display)
func set_emotion(emotion: String):
pass # load a sprite or something

💖Make visual novels with DIISIS
- ⧋Getting Started▽
- [VN Template Tutorials]
📈Getting Started
- High Level Overview
- Line Types
- Text
- Choice
- Instruction
- Folder
- Editor Overview
- LineReader & Parser
💥Interactivity and Reactivity
🧠 More Knowledge
- Upgrading to a new version
- Shortcuts
- Dropdowns
- Header
- Text Ingestion
- Adding argument restrictions to functions