Creating a conversation 2

In the last tutorial, we created a two-level conversation tree, but it's a little basic. We want options to appear organically as we choose other options, and we also want some options to give different responses when chosen more than once. We'll add both of these features now.

First of all, we don't want the player to declare their love of hippos until they've learnt something about them, so let's disable this option by default. Select our Hippos base conv prefab, and open it's Inspector. In the Inspector window, we can see more options than we can in the Conversation Editor window. Choose I sure do love me a hippo from the list of Dialogue options, and uncheck Is enabled?. This will keep it hidden when the Conversation begins.

We’ll want to enable this option once the player has asked a question - that is, chosen either of the two question options we created in the Hippos questions Conversation object.

Return to the Talk about hippos Cutscene, and find the branch of Actions related to the Where to hippos live? dialogue option:

Create a Dialogue: Toggle option Action beneath it, and set it to the following. When run, it will enable the I sure do love me a hippo option in the first Conversation:

Re-wire the branch so that this Action is run following the two speech Actions, and we return to the conversation Action afterwards:

We’ll also want the disabled option to appear if we ask the What’s their latin name? question, so re-wire that branch to end on that Action as well:

Now, once the player learns a fact about hippos, they’ll be able to tell the NPC that they love them!

However, if people start repeating themselves in real life, people take notice. So let's give the NPC something different to say each time the player declares their love of hippos. So that our game can keep track of how many times the player has chosen this option, we'll need to create an Integer variable. Go to the Variables Manager, and click Create new Local variable. We'll be using a Local variable, since we only need it to exist in the current scene.

Set the Label to Love declarations, the Type to Integer, and leave the Initial value as 0.

Return to the Talk about hippos Cutscene, and find the branch of Actions related to the I sure do love me a hippo option:

Create a Variable: Run sequence Action in an empty space, and set it up as the following:

This Action will cycle through it’s three output sockets, running a different one each time the Action is triggered. We can use this to make our NPC give different responses each time the player chooses the I sure do love me a hippo option.

Drag this new Action, and the two speech Actions that make up the option’s branch, into a clear space, and re-wire them as follows:

This means that the NPC will only reply “Me too!” for the first time that the player chooses this option. Create a new Dialogue: Play speech Action for the two other output sockets on the Variable: Run sequence Action as follows:

As with the “Me too!” response, re-wire these two new Actions so that they return to the Dialogue: Start conversation Action that starts this Cutscene.

Re-run the scene and test out the conversation. You'll have to ask a question before you can tell the NPC that you love hippos - and when you do repeatedly, you'll get a different response each time.

Adventure Creator and this website are copyright Chris Burton, ICEBOX Studios

Go to top
Do NOT follow this link or you will be banned from the site!