# \[Tutorial\] Very basic dialogue system

**URL:** <https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [January 4, 2015, 11:28pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284 "2015-01-04T23:28:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hakabane](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hakabane](https://forums.unrealengine.com/u/Hakabane)\
**Post date:** [January 4, 2015, 11:28pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/1 "2015-01-04T23:28:04Z")

</div>

Hey All,

I’ve seen some pretty interesting ideas for dialogue systems, including one by @ Epic ([A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums](https://wiki.unrealengine.com/NPC_Dialogue_System_Tutorial)) and thought I would show my own idea on how to create one. This system is very bare bone, but could be modified very easily once you understand it. I think it works pretty good but would love feedback as I plan to modify it in the future.

Anyhow, this project is very simple to set up. please let me know if I have mistakes that need to be fixed.

Edit: Project type is third person and version is 4.7

This tutorial will need the following things made in the content browser:  
2 widgets:

- Choices
- DialogueScreen

3 structs:

- DialogueTree
- NPC\_Reply
- PC\_Choices

1 actor:

- DialogueSystem

The first thing we need to do is in the MyCharacter BP. Add the following two functions and run them on the event begin plays as follows:

Event Graph:

 ![Character Event Graph.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/c/6/bc6548888a4f6341f57a5e1bf7e4a99b321cd22f.png)  
Init Mouse: Make sure to set all the bools to true  
 ![Init Mouse.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/4/f144f02f584d33b7ad23aac74b79bf7d7bba6939.png)  
Spawn Dialogue: You do not need to promote the transform to a variable like I did, I just prefer it over the make transform.  
 ![Spawn Dialogue.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/6/5/665450371e51918623ad5db7bad3e3d694bb2592.png)

The second thing to do is to set up how the widgets will look in the designer.

**Choices Widget**  
This widget is simple, just add a text box and wrap it with a button.  
The text needs to be a variable, mine is ChoiceText.  
The button does not need to be but make sure “Size to Content” is set to true. Also add an “On clicked” event to this button. The only code for this widget goes there.

Inside the widget add two variables  
Bool - Exit Conversation  
Integer - Link To Node

Here is the how the BP looks but you won’t be able to set it up until we make the Load Dialogue Function in our Dialogue Actor.

 ![Choices Widget.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/1/6c13069fbb400620981e197ee7d608f8aa00b893.png)

**Dialogue Screen Widget**  
This widget has no code so you can set it up however you’d like but this is how I set it up:  
 ![DialogueScreenWidget.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/9/6/196660833dbd3459adcf9a024848440d550a1787.png)

NPC Responses text must be a variable  
Choices border does not need to be a variable like it shows in mine but I would set it’s size to fill.  
Choices Vert Box needs to be a variable

Now lets set up our structs, they are pretty straight forward.

**PC\_Choices**  
Text - Reply  
Integer - LinkToNode  
Bool - ExitDialogue

**NPC\_Reply**  
Text - NPCReply  
PC\_Choices(struct) - PC\_Choices (make it an array)

**DialogueTree**  
NPC\_Reply(struct) - Conversation (make it an array)

 ![StructSetup.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/8/4c8d933d44117f8f023d6cda0044bc005f450499.png)

\*\*Dialogue Actor \*\*  
Don’t forget that once you set this up, you can go back to the choices widget and set it up correctly.

Create one custom variable and set it to the type “Dialogue Tree (struct)” - I named mine dialogue test for this.

Event Graph

 ![Event Graph.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/8/2/e824e6b3b017a2368dacf896e5fbecdde6dee577.png)  
Promote the return value from the create widget and set it to Dialogue Widget

Create a new function “Start Conversation”

 ![Start Conversation.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/b/5/cb5fe1e9ebfcdc6da22a47dc81fc7539e5e81b4e.png)  
Promote the as dialogue screen value and set it to Dialogue Screen Cast

Create a new function “Load Dialog”  
This is a bigger function so it will be multiple screen shots.

Part 1

 ![Load1.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/1/981230a385f9d986974039b0b55700a3f1f3d277.png)

Part 2

 ![Load2.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/f/0/f09484908d33f6986b0d3f2f1bb7503f867b025c.png)

Now for the last part, setting up the actual conversations and how it works.

This may be kind of confusing at first so I will do my best to explain it since this is the guts of the setup.

In the dialogue actor, click on the variable you made called dialogue test. (for my screen shots, I drug the details panel out into the open and set it to full screen to set this up, makes it easier)

Here is the opening statement and what it would look like when fully expanded.

 ![Load2.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/4/2/4428b643f84848176573fbc89f7201cf041487c5.png)

NPC\_Reply: This is the text that will fill the screen above the players choices, its pretty straight forward. Each time you add another element it becomes a new “screen” that is accessible for the player. (the elements array number is the number you’d use in the link to node below)

Conversation: This is an array/list of choices you can set for the player to pick from. Each element you add will become an option the player can click on

Link to Node: This is used to pick which screen you want to load next.

Exit Dialogue: If this is set to true, and the player clicks it, the dialogue menu will close.

In the picture above, you can see this conversation is Node 0 - This means it will be the opening conversation. You can also use 0 to link back to this screen from any other PC\_Choice you’d like to.

here is another picture:

 ![Opening.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/7/3d7fa1e49b42a7202f47e5efea830ff44d2da935.png)

In this picture you can see I added another conversation screen. If the player chooses the option for “wanting more information” I set the link to node to 1 which will load the next screen.

The other two I left at 0 for now so it will just reload the same screen but the you’ll notice the third has the exit convo set which will end the conversation (by hiding the widget)

In the second conversation, every option will link back to the first screen creating an infinite loop of sorts.

Edit: Another way you can do this too is when you set the dialogue widget, change the variable type from User Widget and set it to the Dialogue Screen and you can remove the start conversation function altogether and replace all the existing dialogue cast nodes with the dialogue widget variable.

 ![Options.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/b/0/4b05f989d2759b62aeaf1ecaea412cb1b1514f6e.png)

Edit: Here is what it looks like in game

 ![Ingame.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/a/2/a2836369b10ae379dc42ce2e06e635cdce07366f.png)

You can expand on this system infinitely.

If you have any questions or feed back on how this system could be made easier/ more efficient please let me know.

In the future I do plan to add more features like activating quests, opening shop menus, and many other things. I just hope this helps some people with basic dialogue systems.

---

<div class="post-metadata">

**Author:** ![Fen](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fen/32/635651_2.png) [@Fen](https://forums.unrealengine.com/u/Fen)\
**Post date:** [January 4, 2015, 11:46pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/2 "2015-01-04T23:46:20Z")

</div>

Hello,  
Another cool gift ! Thank you ^^

Edit : Have you seen this one too ? [[TUTORIAL BP] Dynamic Conversation - Community Content, Tools and Tutorials - Unreal Engine Forums](https://forums.unrealengine.com/showthread.php?55607-Dynamic-Conversation-BP-Tutorial) i haven’t got time yet to check it yet.

---

<div class="post-metadata">

**Author:** ![Hakabane](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hakabane](https://forums.unrealengine.com/u/Hakabane)\
**Post date:** [January 4, 2015, 11:56pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/3 "2015-01-04T23:56:27Z")

</div>

I’ve seen the thread but I haven’t read through it all the way.

---

<div class="post-metadata">

**Author:** ![Ulrich.Thummler](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ulrich.Thummler](https://forums.unrealengine.com/u/Ulrich.Thummler)\
**Post date:** [January 5, 2015, 4:01pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/4 "2015-01-05T16:01:04Z")

</div>

thanks Hakabane this is very helpful 🙂

I have one question, what use the “DialoqueWidget” in the DialogueSystem for a Actor?

---

<div class="post-metadata">

**Author:** ![Hakabane](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hakabane](https://forums.unrealengine.com/u/Hakabane)\
**Post date:** [January 5, 2015, 6:16pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/5 "2015-01-05T18:16:01Z")

</div>

The dialogue widget is just where I design out how my widget will look. You could make it just one widget but I like to break my stuff apart.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [January 26, 2015, 6:29pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/6 "2015-01-26T18:29:24Z")

</div>

Hey Hakabane,

Sorry it took so long to take a look! I had a look over and really like how you have this set up. the only question I have is how easy is this to edit for individual npc options? Do you have the variables set up to where they can be independently editable? This is an awesome system and if I get the time I’m going to run through and set this up on my own to see where my tutorial can be improved!

---

<div class="post-metadata">

**Author:** ![Ollinator](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ollinator](https://forums.unrealengine.com/u/Ollinator)\
**Post date:** [January 26, 2015, 10:13pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/7 "2015-01-26T22:13:12Z")

</div>

i dig this system for its simplicity! well done, hakabane and thx for sharing!

@: if im allowed to give you one advice: use screenshots of your blueprints with only the important things written down, instead of describing everything in prose…it’ll be much easier to follow through and much much less error prone! and its prolly faster for you to write and update… ^^

---

<div class="post-metadata">

**Author:** ![Hakabane](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hakabane](https://forums.unrealengine.com/u/Hakabane)\
**Post date:** [January 26, 2015, 10:55pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/8 "2015-01-26T22:55:06Z")

</div>

Honestly it should be pretty easy to edit any part of the NPC but I want to make a GUI for it so it’s easier to work with. It would be much easier for people if they could see which options lead where. Kind of like how Blueprints work with the lines between nodes. I really hope to make a better version that with my RPG Template I’m making so that you can activate quests, open shops menus, or other misc options.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [January 27, 2015, 3:00pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/9 "2015-01-27T15:00:27Z")

</div>

[=Ollinator;211616]  
i dig this system for its simplicity! well done, hakabane and thx for sharing!

@: if im allowed to give you one advice: use screenshots of your blueprints with only the important things written down, instead of describing everything in prose…it’ll be much easier to follow through and much much less error prone! and its prolly faster for you to write and update… ^^  
[/]

Hi Ollinator,

I’ll definitely take that into consideration, I know I can be a bit long winded :). I always welcome suggestions or constructive criticism so I can improve the quality of my tutorials, if you have suggestions please feel free to let me know!

---

<div class="post-metadata">

**Author:** ![MikeHazeJr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MikeHazeJr](https://forums.unrealengine.com/u/MikeHazeJr)\
**Post date:** [March 18, 2015, 12:42am UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/10 "2015-03-18T00:42:41Z")

</div>

can you upload this as a blueprint component?

---

<div class="post-metadata">

**Author:** ![Hakabane](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hakabane](https://forums.unrealengine.com/u/Hakabane)\
**Post date:** [March 18, 2015, 12:58am UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/11 "2015-03-18T00:58:18Z")

</div>

I’m actually reworking this currently and connecting it to a quest system. Converting just the dialog to a BP Component should be simple enough if you follow along with whats above. Once I finish converting all my systems to BP I plan to release them all on here for free. Granted I’m not the best coder so it will need work but it should work enough to get people started.

---

<div class="post-metadata">

**Author:** ![MikeHazeJr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MikeHazeJr](https://forums.unrealengine.com/u/MikeHazeJr)\
**Post date:** [March 18, 2015, 3:37am UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/12 "2015-03-18T03:37:36Z")

</div>

ok thanks for responding. and this is fine, but the first attachment is invalid. unless that is just junk, is that not appearing going to be relevant?

---

<div class="post-metadata">

**Author:** ![Hakabane](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hakabane](https://forums.unrealengine.com/u/Hakabane)\
**Post date:** [March 18, 2015, 6:53am UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/13 "2015-03-18T06:53:17Z")

</div>

I’m not sure why the picture stopped loading but I re-uploaded it. it was pretty basic.

---

<div class="post-metadata">

**Author:** ![anon35804172](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon35804172](https://forums.unrealengine.com/u/anon35804172)\
**Post date:** [March 25, 2015, 10:54pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/14 "2015-03-25T22:54:56Z")

</div>

Hey hakabane , i’m having a problem, that when i choose the first choice, for exemple, it goes to the next screen but the first one doesn’t disappears.  
Thank you very much man!

---

<div class="post-metadata">

**Author:** ![Hakabane](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hakabane](https://forums.unrealengine.com/u/Hakabane)\
**Post date:** [March 25, 2015, 11:05pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/15 "2015-03-25T23:05:45Z")

</div>

Check to make sure you are clearing out the widget’s children in the part 1 section. if not it will just add a really long annoying list over and over.

---

<div class="post-metadata">

**Author:** ![anon35804172](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon35804172](https://forums.unrealengine.com/u/anon35804172)\
**Post date:** [March 26, 2015, 12:40pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/16 "2015-03-26T12:40:43Z")

</div>

It’s not in kind of a loop , the first screen just stay there and the second one appears almost like by it side. For some reason is not clearing the first one, just the second.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9d5983b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9d5983b](https://forums.unrealengine.com/u/anonymous_user_b9d5983b)\
**Post date:** [August 20, 2016, 10:40pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/19 "2016-08-20T22:40:26Z")

</div>

Close to the end is where I’m lost…

Hello Hakabane,

So I managed to go through your the dialogue system tutorial but here is where i got stuck, it happens to be that i can’t find the choices text…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_595f74f21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_595f74f21](https://forums.unrealengine.com/u/anonymous_user_595f74f21)\
**Post date:** [August 22, 2016, 4:07pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/20 "2016-08-22T16:07:02Z")

</div>

I knew the dialog system was done with arrays. because I have over 1,700 arrays in my own game and some of them are nested inside of each other and others are not (depending on the  
type of conversation whether its multiple branched or not) So I got the dialog working in windows script form, but not in the unreal blueprint code.

---

<div class="post-metadata">

**Author:** ![HaxO](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/haxo/32/1008648_2.png) [@HaxO](https://forums.unrealengine.com/u/HaxO)\
**Post date:** [August 22, 2016, 9:50pm UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/21 "2016-08-22T21:50:17Z")

</div>

Neat! Thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_595f74f21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_595f74f21](https://forums.unrealengine.com/u/anonymous_user_595f74f21)\
**Post date:** [August 27, 2016, 3:32am UTC](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284/22 "2016-08-27T03:32:34Z")

</div>

It is all done with arrays to branch dialog or to make complex or to link it to certain events  
variables to it. Even to hide or unhide things. Arrays can do all sorts of Complex stuff.

Without them I could not create Tesseract Prime Offworlds. My game.

[Next page](https://forums.unrealengine.com/t/tutorial-very-basic-dialogue-system/18284.md?page=2)
