dialogic-godot / dialogic

💬 Create Dialogs, Visual Novels, RPGs, and manage Characters with Godot to create your Game!
https://dialogic.pro
MIT License
3.54k stars 215 forks source link

Await Background Finishing #2143

Open CakeVR opened 3 months ago

CakeVR commented 3 months ago

Adding the option for the timeline to await a background to finish will add more power for cinematic background scenes.

For instance, awaiting an animation to finish playing before the timeline will advance. Similar to awaiting character transitions.

I would recommend to add a finish method, like we have for events.

Pheubel commented 2 months ago

It actually does have a call to finish already (see addons/dialogic/Modules/Background/event_background.gd line 60).

Instead, what I think would have to happen is that the call to update_background() needs to cause the execution of the event to stall until it is finished. Diving into that function, between lines 126 and 135 seem like a good place to have logic related to waiting for the background to finish.

One way to do this is to have a timer run and wait for it to expire.

In my opinion backgrounds should by block the execution of the timeline, but with an optional setting where the transition can become skip-able upon receiving user input. Additionally with another mode to have the same behavior as now, where it just gets told what background to show and nothing more, for scenarios where background changes should happen during dialog, like exposition scenes.