Intro to Dialogue Tree 1: Quick Start Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi my name is Zach and in this tutorial I'll be showing you how you can use dialog tree to get dialogue set up in your unreal 5 project in just a few minutes if you don't already know dialog tree is a free plugin available on the unreal Marketplace that offers an easy to usee system for creating and editing in-game dialogue at the end of this tutorial you'll have a simple dialogue up and running that consists of a single NPC speech and two player responses keep in mind that this is a quick start tutorial as such I'll be keeping explanations to the bare minimum you need to get dialogue up and running future tutorials will go into further depth I'm going to assume a basic knowledge of the Unreal Engine and blueprint scripting I'll also assume that you've successfully installed the plugin from your library in the Epic Launcher as normal I'm going to be using epic's third person starter project as a base but you should be able to follow along with any project that you like with that out of the way there are three key objects that will'll need to get dialogue set up the first one is the dialogue controller you can think of this as the conductor or the traffic cop for your dialogue it essentially governs the look and feel of your dialogue and what happens when your player interacts with it the second key object is the dialogue asset this is where you get to write the content of the dialogue itself who says what and when finally we have the speaker component which attaches to your characters and lets them interact with your dialogues before we get started I want to address a small change to the dialog controller that was made in the plugins version 1.1 update as mentioned previously the dialogue controller is an actor that governs the user interface for your dialogues before the update you had to manually drag your controller into the level after the update this step can be skipped as the system now automatically spawns in and manages a dialog controller for you if you want to use a custom dialog controller or configure the settings on the default controller you can now do so in Project settings under dialog tree I'll go into this more in the updated customization tutorial but I wanted to give the change a brief mention here just in case someone was coming back to this Tut after watching the original version next up we want to create a dialog tree asset this is where we'll Define the actual content of a conversation right click in the content browser and select dialogue tree I'll name mine DG for dialogue and then test dialogue double clicking on your new dialogue asset will open the dialog tree editor the details of the editor will be covered in a later tutorial for now we'll stick to the most important points in the upper right hand panel you can see the dialogue speakers this is where you can change the names the dialogue uses to refer to its various speaking roles the dramatis Persona if you're feeling Shakespearean keep in mind that this speaker name is for internal use by your dialogues we'll set the display name separately a little later on for the purposes of this tutorial we'll leave the default speakers in place that means we'll have one speaker we refer to as player and another we refer to as NPC let's create a simple dialogue right click in the graph and under speech nodes select NPC input transition this creates a node which will play its content and then wait for the player to select an option from among its child nodes you can give the speech some text from the details panel in the lower right I'm going to very creatively have mine say hello world we can link the speech to the entry node by dragging from the entry's output pin onto the speech's input pin but what good is an NPC speech without the ability to respond right click in the graph and select two player Auto transitions speech noes with an auto transition play their content and then proceed immediately to the next note in the chain perfect for player options for text I'll have the first option say goodbye and the second say leave without saying anything you can link these options to the NPC speech just like we did before by clicking and dragging between pins notice that output pins without a valid node to transition to turn red this means that transitioning through that pin will exit the dialogue which which is exactly what we want in this case compile and save we've now created our very first dialogue let's get it playing in game we'll start by adding a speaker component to our player character so it can interact with the dialogue open the blueprint for your primary player character in this tutorial I'm using epic's third person starter project so I'll open BP third person character in the components panel click add and select bpc speaker component you'll see a crpg version as well which includes portrait data but we'll just use the basic version for now in the speaker components details panel we want to set the display name and the dialogue name the display name controls how the speaker's name will appear in text you can set it to whatever you want the dialogue name is used when attempting to automatically match the speaker component to its role in dialogue set this to player to match the name we used in the dialogue compile and Save that's the player speaker component out of the way but as the saying goes it takes two to tango let's create an NPC right click in the content browser and create a new actor blueprint I'll name mine BP NPC open the blueprint editor for our new NPC the first thing we want to do here is give our character a mesh that we can see it in game add a static mesh component of your choice I'll go with a cube and I'll make it orange so it stands out next up add a speaker component just like we did with the player in the details panel change the speaker component's display name to be whatever you'd like and its dialogue name to NPC to match its role in the dialogue the owned dialogue field allows you to specify a default dialogue asset for a speaker component to use let's set this to the DG test dialogue asset we created earlier with that done we need a way of telling the controller to start our dialogue for this example we'll start dialogue whenever the player approaches the NPC you'll probably want something more are nuanced in your own game but for demonstration purposes this will do nicely under the NPC's components click add and select sphere Collision set the sphere's radius to 150 or whatever you prefer this is going to be the collider that detects whenever our player gets close to the NPC scrolling down to the sphere collisions details click the button to add an on component begin overlap event in that event we'll first check the overlapped actor for a speaker component using a get component by class node if that's valid then we'll call start owned Dialogue on the MPC speaker component and we'll pass in both speaker components as an array this will start the NPC's own dialogue with the NPC and whatever speaker overlapped it using the two speaker components dialogue names to match them into their correct roles in dialog compile save and drag our new NPC actor into the level all that's left is to test it press play and approach the NPC Cube the dialogue we created should start as soon as we come within range and close again whenever we select either option and that's all there is to it to sum up in this tutorial we covered how dialog controllers relate to our project how to create a simple dialog tree asset how to set up speaker components and how to get the dialog to play Future tutorials will go into greater depth on the dialog tree editor as well as how you can fully customize the feel and appearance of dialogue I also encourage you to play around with the quick start tutorial we created here adding additional speeches and tweaking their properties if this video was helpful to you please give it a like And subscribe so you get notified when videos showcasing new features come out if you have any questions or feedback I'd love to hear from you on my Discord Channel and if you're enjoying the plugin I would be Beyond grateful if you could take a few seconds out of your day to leave me a review on the unreal Marketplace finally if you'd like to support further development on the project you can do on patreon.com links to all of that as well as the plugins documentation site will be posted in the description in the meantime thanks for watching best of luck and happy developing
Info
Channel: UnraedGames
Views: 1,848
Rating: undefined out of 5
Keywords: Unreal Engine 5, UE5, Dialogue, Dialogue Tree, Dialogue System, Plugin, Game Development
Id: IDR6i8hmXJg
Channel Id: undefined
Length: 8min 40sec (520 seconds)
Published: Fri Mar 29 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.