Dialogue Plugin

  1. Does it work if you put it on an NPC node?
  2. If not, could you post a screenshot of how you spawn the dialogue widget? Might be a problem there.

Hello there, I’m trying to use this plugin for an RPG that I’m making and I’m wondering about multiple dialogue’s for the same person. To be more precise, have an NPC who has one dialogue at the start, and then has a different dialogue after a certain event (like finishing quest). My first thought was to create a single dialogue file that has multiple start points and then have an event that just changes which start point to pull from. So first off, is that possible? And if not, what would you suggest?

You can either keep all your dialogue trees in a single dialogue file, or you can change the NPC’s dialogue reference through an event once the quest has been completed.

The first scenario requires you to keep a variable on your player that you’d save in a savegame.
The second scenario requires you to save the state of your level in a savegame, and then restore it, so your NPC would always reference the correct dialogue file.

I think the first one is easier and is more versatile. The two approaches can also be combined, if required.

I’m sending a new version to the marketplace today, should be up in about a week.

I’ve made some changes to the default UMG widget.

  1. Added a node PlayDialogueSound, which makes sure that you never play 2 sounds concurrently (by interrupting old sounds). Also added StopDialogueSound node, in case you want to call it when you quit the dialogue, for example.
  2. Added a visual representation of a dialogue line that’s currently being selected:

https://i.gyazo./926839cfdbf1e9f53c0492559c4e25f8.png

  1. Moving the mouse away from a line keeps it selected.
  2. Clicking on a selected line is now also possible through gamepad’s bottom face button (even if you selected it through mouse hover). So a player can switch between keyboard and gamepad at any time.
  3. Selecting a dialogue line is possible through mouse hovering as before, but now also by using gamepad (up/down on the d-pad). The widget is now more gamepad friendly out of the box.
  4. If a sound is playing from a player voiced line, displaying next NPC lines is delayed until your player finishes saying his line, but you have a “continue” button to skip the delay.
  5. I may have fixed a bug where player nodes didn’t fire events (not sure if this was done in this version or before that).
  6. Added a few instructions to the documentation regarding how to override demo widgets.

In short, these are general improvements that should be useful for most people, but most importantly they’re optional.

  • E.g. if your player lines are never voiced, you shouldn’t worry about the #6.
  • If your game doesn’t support gamepad, you don’t have to worry about #4 and #5.
  • If you don’t want to have a currently selected line (#3), simply disconnect the HighlightSelectedReply method from its body.

Resubmitting again today, because I added some more things.

  • Added Copy, Cut, Duplicate and Paste functionality (hotkeys use editor’s standard bindings).

  • Copying nodes produces Json, so it’s possible to paste nodes to notepad, to other dialogue viewports or to send the output to other team members through instant messaging.

Example:
Copy the two selected nodes from the screenshot:

https://i.gyazo./761e1ad725e9925baa819006b9122578.png

Pasting it to notepad looks like this:

https://i.gyazo./04053b741144df5e610c2b9a1e501b0f.png

Update: I haven’t figured out how to correctly serialize/deserialize conditions/events yet, so when you paste nodes, their conditions/events will be empty for now.

The update has been processed by the marketplace team.

I downloaded to test it and noticed two problems.

  1. when you launch your project, you may get a warning about DemoDialogueWidget referencing an unexisting asset. It’s a fake warning, because it doesn’t actually reference it in any way. I’ll fix it in the next update. Or you can just fix it yourself by doing “Refresh Nodes”, then hit Compile & Save.

  2. Trying to copy nodes that have events/conditions that reference assets - will crash the editor. It’s some old code that I forgot to remove.

I’ve submitted a fix. Hopefully it’ll get processed soon.

Fixed version is now live.

I love this plugin, great job .

Does anyone have a quest plugin/system that would work well with this on MAC as well? Unfortunately the solution I was planning on using (https://www.unrealengine./marketp…uest-extension) does not work on MAC. I’ve been working with that author for a while to try to get it up and running but for some odd reason, the stubborn thing will not show up on a MAC.

You could use this plugin as convenient base for quest system.
Most of this code (and the most useful one) is the generic node editor. It’s super easy to remove dialogue data and logic.

  • Data for this editor is defined as UDataAsset, simply addd your properties in C++.
  • Add your custom logic for quest system in C++ or blueprints.

Yes, writing it on your own still does requires C++ skills.

There’s no need for a quest system to be node based. I considered making a quest system at some point, even put its general architecture on paper, and it wasn’t going to be node based. In RPGs such as Pillars of Eternity it’s not node based either.

It’s just my opinion, of course (except about PoE, which is a fact).

Of course, different game would different method for scripting events and story :slight_smile:

Still… it was quite easy and efficient in one of my projects to use Dialogue Plugin as “screenplay plugin”.
One of the biggest advantages is that I can easily analyze such graph from code. And use this info to pre-load assets soft referenced in “upcoming” nodes, read the path leading to specific node aka “specific moment in story” (one of things needed for automated testing).

Such generic node editor could be truly useful for many games. I even considered describing usage of such tool for implementing quest/story/events. Probably I will… in spare moment…

That’s why I’m happy that you addedd copy-paste functionality. Thanks!
Now I’m hopping for a Node Search;)

Hi , before all 4 of us buy your plugin, we have 2 questions.

a, For our lip sync system to work, for every section spoken, we need to send an event which contains the string info, as our lips sync system needs to analyze the text itself.

b, do you plan for the future, to create a way to create an interface for creating multiple language variations of the text?

Thank you for your time

The first thing can be done my slightly modifying the UMG widget. When a text line is displayed, simply call your lip-sync method with the same text as parameter. I’ll show you exactly where this can be done if your programmers can’t find it. It’s a small widget, there’s not much stuff in it. Just shoot me an email if you need assistance with this.

The second - the plugin is configured to work with Unreal’s native localization system, which does everything you might need.

So I’m trying to use Get Game Mode in the Dialogue Conditions bp, and my cast to my game mode is failing because “no world was found”, which I’m finding nothing on google about. I did find this link https://forums.unrealengine./development-discussion/c-gameplay-programming/44901-uobject-vs-actor-event-graphs?73680-UObject-vs-Actor-event-graphs= where in the 5th post they describe how to get world from uobject children. So I dug into your files and found this,



    // It is assigned in DialogueUserWidget.cpp just before calling IsConditionMet()
    UPROPERTY(Transient)
    UWorld * World;

    virtual UWorld* GetWorld() const
    {
        return World;
    }


But looking in the DialogueUserWidget.cpp I’m not seeing world being assigned, unless it’s coming from elsewhere and you’re referring to the order of execution.

Basically I just need a way to get the game mode through the conditions, and probably from events as well, but I haven’t checked there.

Thanks for reporting it. I forgot to make World available inside conditions. I made it work for events (get game mode would work there), but forgot to do the same thing for conditions.

I’ll upload a fix right now, and it’ll probably get published tomorrow or the day after. In case you want to patch it yourself, here’s the diff.

No problem, thanks for the quick fix and notes. Did you get that from Zh Khang Shao? I ran into his post while trying to figure it out. Bit over my head, but seems brilliant. I’ll also say that your move to make condition and event objects was genius, really opens up possibilities.
I will ask though, off the top of your head can you think of a way to link the text in the dialogue nodes to another text. As an example, the option would say something like “accept” and then send a linked text to a separate widget with actual dialogue. Already know to link to other widgets/ widget components so that’s not a problem.
I haven’t delved into your data asset code for the dialogues and nodes myself, but if I do before you reply I’ll edit this message.

Don’t know who it is.

Can’t take credit for it. This was suggested to me by Brune from Underflow Studios.

If I understood you correctly, then what you want to do is simply create an event with a Text field, and the logic of the event would open a separate widget and put the Text parameter into the widget. Unless I misunderstood, of course. I didn’t quite get what you mean by “separate widget with actual dialogue”.

For the seperate widget I meant that I use a widget component on npc’s to display their nodes of the dialogue directly above them. I probably should have thought of that myself, though I think I’m going to first try to add another text field in the nodes themselves, one which will display an overview of what the reply will be, and then another field that will be the spoken words. The spoken words I may create another widget for the player to make their spoken dialogue appear above their own head.
I worded what I meant kind of weird. Thanks for the idea though, perfect contingency

Let me know if you need assistance with creating a second text field and displaying it inside nodes.

Guys seriously, you just need to manage few nodes to get the finish the voice audio then go to the next nodes… Don’t bother him with that