Dialogue Plugin

It’s possible to do if you tweak the plugin a little bit.
Before doing it, make sure that the plugin has been duplicated into the project (paragraph 7.4 of the documentation), and that the Widgets have been duplicated into the project (paragraph 3.1 of the documentation).

Here’s where the DialogueEvents are executed in the Widget:

https://i.gyazo./b7e8b24a13097a256c963cf52875e447.png

This leads us into C++, where we’ll see the following code:

https://i.gyazo./7744d96acc5e78aa0dff82e1c81792c5.png

So all we have to do is re-implement this piece of code in blueprints and add a delay when necessary.

Go into Dialogue.h and add **BlueprintReadOnly **into the Event’s UPROPERTY like this:

https://i.gyazo./6b08a267b57cac09c429a5003396b2e0.png

Recompile. Open the project and create a DialogueEvent called “DelayEvent”. Give it a float parameter called “Delay”, mark it instance editable as usual.

Go into MyDialogueWidget and create a variable of type float called “delayNextEvent”. Then create a blueprint event called “ExecuteEvents” and give it the following code:

https://i.gyazo./e193669866ec548148b46313493db840.png

Now replace “RunEventsForNode” with your new blueprint event:

https://i.gyazo./42228d2c6b95e75b85f41f1a76f4865e.png

That’s it. Now you can have the following setup:

https://i.gyazo./05aab6c0001f33ec38ecf7917a5e11d6.png

A small “gotcha” is that if you have a setup that does this:

  • do A
  • wait 2 secs
  • do B
  • wait 3 secs
  • do C
    then in reality, you will need to set the second delay to FIVE and not THREE.

If you do this:

  • print A
  • delay 2 secs
  • print B
  • delay 5 secs
  • print C
  • print D
    then you’ll immediately have A and D printed, then two seconds later you’ll have B, and then three more seconds later you’ll have C.

But now that I’ve exposed the delay functionality to you, you can rewrite it to make it cumulative if you want.

As for when a dialogue node should move on to the next node automatically (instead of displaying a Continue button), I can tell you where it’s handled if you want, although if you look at the DialogueWidget main graph, it’s not difficult to find. Adding a delay there, and then moving on to the next node should be easy to do, but let me know if you need help with that. We’d have to discuss some specifics and edge cases, though.