SpielBackupAlt/addons/dialogic/Documentation/Content/FAQ/create-timeline-using-gdscr...

29 lines
771 B
Markdown
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Creating timeline in code?
**Can I create a timeline using GDScript?**
Yes! It's a bit harder since you will have to create each event yourself, and each event has to be **valid.** To get an idea for how to build one properly, open an already created timeline with a text editor and see how we set ours up as an example for yourself. We'll be adding a better tutorial and documentation on this process eventually.
Here's a simple example:
```
func _ready():
var gdscript_dialog = Dialogic.start('')
gdscript_dialog.dialog_node.dialog_script = {
"events":[
{ 'event_id':'dialogic_001', "text": "This dialog was created using GDScript!"}
]
}
add_child(gdscript_dialog)
```