Blueprint Dialogue System

The current branch is stored on the BPC_Dialogue in a variable called “CurrentState”. If you need to access it from the dialogue table, you can create a custom function to return it (I don’t believe there’s a built in one for that).

As for disabling but still showing, this isn’t a currently supported feature (I’m surprised I haven’t come across a need for that in my games tbh).
If you’d like to add it, I would suggest taking a look at UI_Dialogue::AddResponseItem() (there are two of them, an event and a function - both might be useful).
You might be able to add additional custom traits in order to do this.

I don’t seem to have this issue, though I may have fixed it at some point on my end. You might be able to change the default values to something else, then back, and then save to get rid of it?

Unfortunately one of them is in something I can’t edit.
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_182216_1580097124310_904”}[/ATTACH]
https://forums.unrealengine.com/core/image/gif;base64

For some reason my previous image didn’t attach… today I went to start my project and it told me that math expression had an error. I was unable to edit anything because it’s “read only”, but when I clicked on it to open it, suddenly everything was unhooked in the math expression.

Looks to be an Blueprint issue. I imagine re-creating the math expression node should do the trick.

Yes, I’d never worked with math expressions before. It turned out to be a simple matter of pressing F2 to rename it and immediately pressing enter, then it was fine. I think I’ve cleared up all outstanding warnings and errors, but I’ll double check it.

Hi

Is there a way to shuffle the branches in a hub so I could change the order of the option is chosen for a quiz?

The “RandBranch” trait](Blueprint Dialogue System - Documentation - Google Docs)should do what you’re looking for, I think.

I tried that before, the RandBrach would only randomize the branch but won’t show in the hub as shuffle choices. Is it possible to do two traits? I was unable to have two traits set up.

Oh I see, I misunderstood. No the system can’t do that yet. You should be able to add that behavior though in UI_Dialogue::SetDialogueTableItem::AddResponseItems

Hey great work on this! Before I buy it I just had a couple questions…

Can I trigger the dialogue through Sequencer events and/or have the dialogue trigger Sequences? For instance, when I walk up to a character and interact with them I want to be able to trigger a Sequence (so I have full control over the camera and animations and all that stuff), while still having the dialogue play out during it and still be interactable.

And second, is there an option to attach sound to the typewriter effect? So as the letters type out they make little click noises or whatever. I could probably just attach a sound file to each dialogue entry, but it wouldn’t be dynamic and follow the speed and end points of the dialogue lines properly.

Thanks!

Howdy, and thank you for the kind words :slight_smile:

The dialogue can be controlled through Sequencer events, so long as you can find the actor and component that will be hosting the conversation. There is a function called SetState which can skip to the dialogue branch you’d want to playback, so you can call this from your Sequencer event handler.

For the sound, I didn’t build that in but in my games I usually put it in the UI_DialogueTextItem initialization (this happens for each text character as it appears on the screen) or OnCharactersDisplayedChanging in UI_Dialogue.

Hey again! Thanks for the tips! Everything’s going really well so far but I’m having a bit of trouble getting the dialogue SetState function to execute off a custom event from my Sequence through a BP Interface. The Sequence Event is set up properly and works in other contexts, but when I try and put it in a child of BPC_Dialogue it doesn’t fire at all… I’m assuming this is because I’m not referencing the Actor that’s hosting the dialogue, so I followed your video tutorial where you set up the BPC_UseScanner in the Character Blueprint, but putting my Event in there doesn’t seem to work either… Any help is super appreciated. Thanks!

Woo well I figured it out! If anyone is curious, here’s how to do it in 4.24:

Add the actor that has your BPC_Dialogue component attached to it to a new track in your sequence > add an event track for that actor > add an event keyframe and then right click on the keyframe and go up to Properties > Event > Quick Bind > then search for your SetState function from the BPC_Dialogue component and select it. It will automatically add an event to the sequence’s Event Graph and make all the necessary connections. The dialogue will now activate wherever you set your event keyframe in the sequence.

2 Likes

I’m glad you’ve figured it out!
Sorry for the delay in responding, we’ve just launched our game so I’ve been buried with things to do all of the sudden.

No worries! Congrats on your game! Sorry to keep bothering you but I think I’ve run into a bug? Or perhaps I’m just doing it wrong. I can’t get setPassiveDialogue to work properly. It will indeed switch to a passive flow when used as a PreAction, but it doesn’t enable the player to walk around during it. And vice versa, if I use the Passive checkbox on the component, it will flow properly and correctly enable player movement, but then when I switch it mid-dialogue as a PreAction, it will switch the player movement off but the player won’t be able to interact with the dialogue menu, leaving it in a bugged state.

I’ve repro’d this on a clean install of your demo map as well. Any ideas?

Ah yea that makes sense, since the command is coming in too late. Since the dialogue needs to know that it will be passive before spawning the UI, but the PreAction isn’t processed until after the UI is spawned. You might be able to pass it through a silent dummy branch that enables the option, I think that might work.

Is there a tutorial on how to set up the inline images? I have copied the csv into my project through the source file in the data table but cant figure out how to get it to populate the table in the dialog asset table

Ok, I solved it. Being new to data bases on unreal, I did not realize I had to import it through the engine.!

Hey, Quick Question. I’m trying to get the UI widget to play an animation at the start of the conversation (Example: black film bars appearing off-screen then the dialogue appears.) I’ve gotten this to work, but the animation replays after each branch of Text. (Animation, Npc DIalogue, Animation, Player Dialogue, Animation… ETC) is there a way to get this animation to play once?

So the UI_Dialogue is respawned for every new state, but the BPC_Dialogue is aware if one is already opened when “SetState” is called.
So in your child class for BPC_Dialogue, override the SetState function. If the variable ActiveUI is not valid, then this is the first time the dialogue opens, otherwise it’s continuing the conversation.
I use this for fading in the start of conversations, and fade out on end of conversations (if the branch name is exit, I’ll fade out before finalizing the exit on SetState in the BPC).

I am encountering a bug when using this.
Basically when i try to go from one sentence to another using branch and if both row has same Speaker ID name then its showing 2nd text as a response text before going to 2nd text itself.
As you can see from image second text which is a branch is shown as response text. This doesnt happen if Speaker ID of both sentence are different names