Dialogue Execution update:
I finished the last biggest part of the system, the execution HUB. From one node, you manage all the execution of the dialogue.
It is composed of five parts. The three to the rights are ways to give information to the dialogue. The two to the left are events fired by the dialogue when necessary.
-
Launch Dialogue
This is the pin you use to launch the dialogue. You use it only once, the dialogue cannot be launched again before it reaches an end or it is terminated.
The Dialogue pin just below is where you select the Dialogue object you want to launch, which means you can launch dialogues from anywhere, not necessarly where you created them.
Once the dialogue is launched, events will be fired. -
Select Option
You use this pin when the dialogue is waiting for an input, after a choice proposed to the player.
The Option ID pin just below is used to tell the dialogue which option was selected by the player. An option’s id is its position in the Options array (see below).
Even if there is no option, just a “press a button to continue” thing, you still use this pin and give any Option ID. -
Stop Dialogue
You use this pin to manually terminate the dialogue, like when the player decides to quit the dialogue before a branch end.
This will tell the dialogue that it can reset and you will be able to launch it again.
Note that it fires the Dialogue End event (see below). -
Dialogue Line
This event is fired each time a NPC-line is encountered in the dialogue (or a player-option directly leading to other player-options).
The String pin carries the processed text of the line, replacing all [variables] by their current value. You should display it in a RichText UI component.
The Options pin carries an Array of OptionStruct. Those are structs containing processed text of each option as well as their visibility and availability (only visible options are in the array).
You should display the line and the different options when this event is fired and wait for player’s input. Then, notify the dialogue through the “Select Option” pin. -
Dialogue End
This event is fired when the dialogue reaches a branch end, or when it is manually terminated through the “Stop Dialogue” pin.
You should close UI elements you want to close here and do anything relevant after the dialogue is ended.
I recommand to make a displayer class (maybe a widget blueprint) that will properly handle every dialogue execution, then pass it relevant Dialogue objects from the blueprint that need to execute a dialogue. This way, you can define your own UI design once and use it everywhere in your game, with a direct and strong link to blueprints.
