Blueprint and non blocking function to make a dialog system

Hey !

I’m trying to make some kind of dialog system directly using blueprint. The way this would work would be that I have a parent “Dialog” blueprint and a lot of child blueprint, each of them representing a different dialog. Each character would have a specific blueprint linked to them to represent their dialog and the logic of the dialog (you already met the character,you make this choice etc).

So, on one hand I would have the blueprint that represent my data, and on the other I would have a Dialog controller (probably my Gamemode) that would give us the player input (for example when the player ask for the next line of dialog, or make a choice).

And we could end up with a dialog looking grossly like this:

And now come my issue, which i guess is kind of obvious for the more UE-savvy around here : there is no real way to make a blueprint graph “wait” for something else. I was hoping that inside my WriteLine or WriteChoice function I could “wait” for the dialog controller to “awake” my blueprint with some input, a bit like corountine in Unity but it seem like this is not exactly possible.

I found some people making something that look like a corountine with some weird while loop and a delay but it really look wrong.

So, is there a way to do what I want (having an execution path in a blueprint that “wait” for other blueprint) ?

And also: Is trying to make some sort of data inside a blueprint the right way ? I would like to make something that can handle some logic and blueprint seem perfect for this but making one child blueprint for each data element might be the wrong way ?

Ok so I might have found a solution.
The idea would be to split the dialog into multiple “node”, which represent a series of line (or other things, it’s not important).

At the end of each node we could ask to go to another node, or make a choice between different node, that’s where the dialog controller would handle thing and wait for the user input.

So I would have one event that would give me the name of the node and some other information, a huge switch statement and the dialog line that we want depending on the

The system of node and of “goto” kind of look like the way baldur gates 3 handle dialogs as far as I’m aware so it might not be the worst idea.

If I put it in blueprint it could look like something like this:

So I could have different check in each node (here I’m checking if the character has the AlreadyMet to change their openning dialog line), I can re-use choices in multiple element, make the dialog loop on itself etc. The dialog would end if there is no GoTo statement at the end of one of the branche.

So I have some kind of solution for my first question I guess, I’m still wondering if it’s ok to script things like dialog in a blueprint ? Any opinions ?