Download

Dialogue System?

Has anyone thought of doing something like this yet?

Is it possible to create a branching Dialogue System using Blueprints? This is the main feature of a game (adventure game) and was just wondering if it was possible. We are still very new blueprints and the whole Unreal Engine itself (coming from Unity). Any help or any advice on where to start would be great. :slight_smile:

Of course it’s possible :slight_smile:

One of the things to keep in mind though is to dynamically call the text from a file or a database, that way you can handle among other things the translations.

Errvald has a good point, you really don’t want to embed your text into the blueprints.

I’d recommend learning about Blueprint Interfaces, Blueprints Function calling etc. by following the Unreal video tutorials and playing around with some features (or a simple interaction system) before jumping onto this.

But yeah, I think it is definitely possible. We’re creating the bulk of our features in Blueprint as well at the moment.

Thanks for the advice guys. :slight_smile:

We are still working through the tutorials, and have learning a lot. We are working the top-down template (to use the click and move controls). We are just trying to put together a quick prototype through the use of blueprint, so hopefully we can get something to work.

So right now, we are trying to figure out how to get “right click” interaction to work. We’ve edited the click and move controller to add a right click action and all we want it to do right now is return the actor name that is right clicked. We have this so far:
edits.jpg

Not sure if this is the way to go about it. We only get the “Invalid” debug statements. We are still learning…slowly…but getting there. Any help would be great. :slight_smile:

why are you try to do?

How about in your pawn have an blueprint interface (like a IsTalkable interface), and a function like “talk to” wired up on right click, and have a trace to see if a talkable actor is nearby, set it up with the blueprint interface and it can send what it wants to say to the player’s hud or something

Delegate the action to the npc, use OnBeginCursorOver to fire a menssage to hud. Try to mantain the player clean of code.

Look in content examples “mouse interface” and “Blueprint_HUD” levels .

Those are great suggestions and advice. :slight_smile:

I’m using the top down template, and with a number of attempts, I can’t the mouse to interact with anything. I’m using the third person skeletal mesh (part of the sample stuff and used in third person and top down templates) and I can’t seem to get it trigger.

I’ve used the “Break Hit Result” based on a right click, and it won’t trigger the actor. (Keeps saying that there is no actor, when I’m clearly clicking on the mesh. I’ve also just tried the OnBeginCursorOver, to simply print Hello to the screen, and no luck there either. The blue skeleton guy has an actor part of it, and I’m using a check for tag that is set up as well (the mesh as the correct tag) and still nothing happens. Not sure what I’m doing wrong haha.

A tip though as I did this before in US. If you don’t have any hurries for this particular part of your game, I’d say start working on other parts, and once Epic added the support to create structs within the Blueprints, then start creating your dialogue system, because they will simplify things much for you.

Otherwise if you’re in a hurry, either use class blueprints instead of structs, or create your struct in C++, and then you can use them in BP.

hi Farshad12 :), why we need structs in BP? is not a unnecessary complexety layer?:confused: or at last for use in simple dialogue system.

Quite the opposite, Struct datatypes simplifies the graph dramatically, when it comes to more advanced systems like dialogue, quest, question systems, and anything of that sort. Not that it’s not useful in simpler classes, but it’s helps a lot with these. My last dialogue system I implmented in US, while it wasn’t too advanced, but I still was using 5 or 6 structs, as well as two classes to manage the whole thing in a decent way with useful features. The question system? a bit simpler, 4 structs.

Again not that it can’t be done without them, I already mentioned a way to work around it, but having them helps a lot. And unless they changed their minds, it’s on the Epic’s list of things to add to the blueprints.

aja, ok, i see, thanks for your time. I am finish my dialog system and I worry if in next updates i have to kick off all.

Don’t worry, you don’t have to kick off anything, IF the system you have by then, gives you what you need and you’re happy with the result. If you’re half done though, and still lots of work to be done in your dialogue system, now that’s a situation that you wanna pause for a minute or two and think about your options.

Are you doing your dialogue system in blueprints?

You Talkin’ me?, yes only BP

That sounds awesome Great job!

So I’ve “given up” on the click on object to activate the dialogue…for the time being. I’m now trying to set it up so that when the player enters the TriggerBox around an npc, a “close to interact” bool variable it turned on, and if it the E key is pressed with the variable on, the dialogue starts. I’ve been trying to figure out how to send messages from this NPC actor to the player and vice-versa, but I can’t seem to get anything working. Any advice on that? I am still using the top down template materials for this.

Hi, I delegate all on the NPC, when the player is inside the trigger i use enable input node, soo the NPC manage the key inputs, and all dialogue system. The NPC use interfaces to send menssages to the player and the HUD. Beware because enable inputs dont work if the NPC is pawn Class, at last for me. https://forums.unrealengine.com/showthread.php?2857-Enable-input-dont-work-with-paws

Yeah, that is what I’m trying to do. I’m not sure if the top-down controller stuff is based off the pawn Class. It says PlayerController, so I would assume not.

But, I’ve also gone back to trying to get my clicking on an NPC to work, but still not sure why it isn’t. I’ve attached 2 images, one that shows how I have an NPC Actor Blueprint set-up, with NPC tag, so it should react to a mouse click. And I have the modified top-down controller I’ve working on and playing around with. As it looks, when I click on the NPC, it should do the move to, and then print “Hello” if it has the tag “NPC”, which it has the tag, but never prints, so it just not picking up the click. I’m not sure what I’m missing, but I do feel like something is.

5fe1f68cb1dbfc45e58dd62cc63241e3c6deb93f.jpeg
2fbf9b1436c85b8fe8b56f389b18a40585346202.jpeg

Sorry about posting so much, but I ended up getting it to work.

What I did was change the Get Hit Result to “Camera” from “Visibility”…not sure why that worked, not too familiar with how it works. But it now only prints “Hello” when I get near an npc.

working-clicks.png