the-lost-memory/project/addons/dialogic/Documentation/Content/Events/040.md

24 lines
854 B
Markdown
Raw Normal View History

2022-11-17 17:52:05 +00:00
# Emit Signal
![image](./Images/Event_Emit_Signal.PNG)
The `Emit Signal` event will emit the signal `dialogic_signal` of the **current dialog node** and pass the given string as an **argument**.
The event does NOT create a new signal!
If you instance your timeline via script, use code similar to this:
```gd
func start_dialog():
var dialog = Dialogic.start("my_timeline")
dialog.connect("dialogic_signal", self, "dialog_listener")
add_child(dialog)
func dialog_listener(string):
match string:
"quest_point_two":
# do something
pass
```
If you instanced the scene using the editor, you can connect the signal like normal in Godot from the `NODE TAB > Signals`.
*If you don't know about signals you should definitely learn about them. For example [here](https://docs.godotengine.org/en/stable/getting_started/step_by_step/signals.html).*