I've developed a modal dialog system where a guide talks you through various parts of the game.
It's quite cool. You can:
- instance it from anywhere
- feed it some data in an array as you instance it
- and that data is used to determine what happens in the dialog screen.
For example I can send it this kind of info:
newDialogNode.data = ["Hi, this is me, what's your name?", "input", "Great name!", "finish"]
#then add_child to show dialog etc
It loads, shows the first screen, you tap, it shows an input box where you can enter your name, tap enter on that and it says "Great name" tap again and it closes. It writes out data etc, quite cool. There's more that it can do but that's the basic idea.
What I want to do though is to do something like:
- instance dialog with a flow as above
- on close of instance, move onto other game flow screens.
- on close of those screens, instance dialog again with a flow as above
Depending on what is chosen you could branch into any particular set of dialogs.
I was thinking of having a _process delta happening and real time watching for variable that are switched on and off but that seems a little wasteful to me.
I could use signals (am using Godot) and depending on signals I could trigger different dialogs. I'm suspecting that's the best way but want to check in first.
What is the best way to handle a branching effect like this do you think?
Thanks so much