Dialogic timelines did not work

Godot Version

4.3.dev1

Question

I want to make a timeline system that plays a next timeline once the first timeline was finished but here when I run the function when timeline was ended Dialogic.start() did not work.

extends Node

@export var timelines : Array[String]

func _ready():
	play_timeline()
	Dialogic.timeline_ended.connect(_ended)
	
func play_timeline():
	if timelines.is_empty() : return
	
	var current = timelines.pop_front()
	
	Dialogic.start(current)
	
func _ended():
	play_timeline() # Dialogic.start() doesn't play here

I am not sure about this and I don’t know your code base, but putting the Dialogic.timeline_ended.connect(_ended) part before you call play_timeline() might fix your problem.
If it doesn’t work:
Can you show the Dialogic class’ script?

2 Likes

I have a feeling that something is wrong with the condition.

If the timelines are “empty” then return and if they are not empty, then what? Your further actions in the function are performed without this condition.
If the array is empty or not, then it turns out to assign to the var current String from Array. And as a result, Dialogic.start(null) if Array is empty.

I can assume something like this:

var default: String = "This was the edge of the universe, you have nothing more to see"
var current: String = ""

if not timelines:  # if array is empty
	current = default
else:
	current = timelines.pop_front()

Dialogic.start(current)

Dialogic class is based from the dialogic plugin which was a dialogue manager.

1 Like