How to End Conversations?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Puppii
Posts: 20
Joined: Tue Jun 06, 2023 6:57 pm

How to End Conversations?

Post by Puppii »

Hi, I'm going crazy here because I think this must be a very simple thing, but I cannot seem to find the info I need.

I have a scene with a modified version of one of the dialogue templates in it. It's working great, pulls the right conversation, and the right portraits from the components on the player and the NPC.

However, when I added a second NPC, with the intention of using the same generic Dialogue UI (but with a different portrait/portrait name driven by the dialogue actor component on the character prefab and the name of the character from the conversation in the database respectively) I get the correct dialogue text, but the first character's portrait and name, and then, if the conversation keeps going, I get the warning message: Another conversation is already active. Not starting 'NPC_02_Convo_01'.

I found several topics on the forums with the same warning, and based on that, it seems like I might accidently have allowed my conversation with the first NPC to keep going indefinitely.
However, I could not find a good best practice to end a conversation.
For my purposes, I would like the conversation to end when it get's to one of the ends of the dialogue and closes out the UI. Or when the character leaves the collider that triggers the start of the conversation. Is there a way to do that for the conversation, or even for all conversations that use that UI?

I'm not sure if it's relevant to this issue, but I am using the Corgi Engine, and the Conversation Zone component on each of the NPCs with a Dialogue System Trigger > On Use and then added the action Start Conversation.
I was thinking maybe I could just add another Dialogue System Trigger > On Collision Exit and then add the action End Conversation, but I don't see that as an option.
User avatar
Tony Li
Posts: 22106
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to End Conversations?

Post by Tony Li »

Hi,

No need for the extra Dialogue System Trigger. Tick the original Dialogue System Trigger's Actions > Start Conversation > Stop Conversation On Trigger Exit or Stop Conversation If Too Far checkboxes.

The warning "Another conversation is already active" means your first conversation hasn't finished yet. If the conversation finishes the final node of the dialogue tree, it automatically ends. If you tick either of the checkboxes I just mentioned and the conditions are true (trigger exit or too far), the Dialogue System Trigger will automatically end the conversation.

If you want to confirm that conversations are starting and ending, temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. When the conversation starts, you'll see in the Console:

Dialogue System: Starting conversation 'title' with actor=player and conversant=NPC

And when the conversation ends, you'll see:

Dialogue System: Conversation ending.

If you don't see that message, the conversation is still active. If you've set the Dialogue Manager's Display Settings > Subtitle Settings > Continue Button dropdown to something like Always, it might be waiting for the player to click the subtitle panel's continue button one final time.
Puppii
Posts: 20
Joined: Tue Jun 06, 2023 6:57 pm

Re: How to End Conversations?

Post by Puppii »

Okay, I realize that I had turned both those check boxes off trying to fix what seems to be another issue.
I turned those checkboxes back on, on both of my conversations, and now when I start a conversation with NPC_02, it opens the first line of the correct conversation, but with the wrong portrait (it's NPC_01's portrait, not the placeholder art I have in the UI) and the console says "Dialogue System: Stopping conversation. Exceeded max distance 5 between NPC_02_ConvoZone and NPC_01"

And this NPC_02_ConvoZone_01 is a child of NPC_02.
When I explicitly tell it to use NPC_02 as the Conversation Conversant in the Dialogue System Trigger component on NPC_02_ConvoZone, the correct portrait does show up, but the conversation still ends because it's too far away from NPC_01.

Is there some other setting I've accidentally set that is making NPC_01 the game object to check for all conversations?
I have the correct actor selected in all the conversation nodes.
I have the correct conversation selected (which I know is working because the correct lines off dialogue do show up before the conversation ends based on proximity).
Anyway, I'm at a loss, and I'm sure it's something simple I'm missing. Thanks again for your help.

EDIT:
Okay, I think I messed something up with all the changes I made to the UI template I started with. I've disabled the UI I was working on, and put one of the other templates into the scene and hooked it up to my database and the two NPCs are working fine.
So I think I'll just take this template and start putting my artwork back into it. See where I went wrong the first time :D

EDIT EDIT:
Actually the new template is having some of the same issues as the old template.
Using the Focus Template without changing anything,
Now, if I don't explicitly assign NPC_02 conversant in the Dialogue System Trigger component, it defaults to NPC_01, if I do assign it, NPC_02's portrait correctly displays on the right when they say their lines, but then they appear over the Player Character Portrait on the Left while waiting for the player's response. But the player's portrait is still there on the left, under NPC_02's portrait (again, this is only if I assign NPC_02 as the Conversation Conversant in the Dialogue System Trigger component.
Also, either way, the conversation with NPC_02 is the correct dialogue, but it keeps looping back into itself when I hit any END node. Not sure how I managed that.

I'm thinking I must have done something strange when I first set up the Dialogue Manger in this scene. I used the wizard, but I cannot remember all the questions I answered.
I'll backup my project and try making a new scene with a new dialogue manager, and see if I can narrow down the problem further.
User avatar
Tony Li
Posts: 22106
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to End Conversations?

Post by Tony Li »

Hi,

This sounds like an actor assignment issue.

Open your conversation in the Dialogue Editor window. Select Menu > Conversation Properties. Make sure the conversation's main properties Actor and Conversant dropdowns are correct. (The main Actor and Conversant names are also shown in the Dialogue Editor window in a watermark in the lower right.) Set the Actor to the player actor (Player) and the Conversant to NPC_02.

In the scene, add a ConversationZone prefab to NPC_02. Set the Dialogue Actor component's Actor dropdown to NPC_02. This associates the NPC_02 GameObject with the dialogue database's NPC_02 actor.

Add a Dialogue Actor component to your player prefab/GameObject. Set the Actor dropdown to the player actor.

The Dialogue Actor components make it unambiguous which GameObjects to use for the conversation.

Leave the Dialogue System Trigger's Conversation Actor and Conversation Conversant fields unassigned. If you want to use a different actor for a particular instance of a conversation, see: Character GameObject Assignments
Puppii
Posts: 20
Joined: Tue Jun 06, 2023 6:57 pm

Re: How to End Conversations?

Post by Puppii »

I think I see the problem:
both conversations I've set up so far (the one that is "working" with NPC_01 and the one that is not working with NPC_02) I have the actor set to NPC and the Conversant set the player's actor in the database.
Then I made a modified version of the visual novel style template "work" with NPC_01 (so that NPC_01's portrait, name, and text appear in the subtitle panel when the conversation starts, and the Player's portrait, name, and response options appear on the left when the player needs to choose a response.

I made a new conversation, and set the actor and conversant as you said.
I'm using the Focus Dialogue UI template.
The conversation starts correctly now, however, when NPC_01 finishes their line, the conversation responses come up correctly, but the NPC_01 portrait appears on the left again, over the player. When I choose a response, it prints that response in the subtitle panel, and then makes the NPC_01 portrait on the left disappear, and re-focuses on the NPC_01 portrait on the right. (I've double checked, and the two response nodes are definitely assigned to the player actor).

Also, this might be a clue as to what I've done wrong, but when I had it set up the opposite way, with the NPCs as the actors in the conversations and the player as the conversant, the Dialogue System Event component that I have on my player prefab correctly freezes the character and disables the Corgi Control pause function.
When the player starts this new conversation I set up, where the player is the actor and NPC_01 is the conversant, the player can still move around during the conversation, like they are not part of it, like that Dialogue System Event is not registering that a conversation has started for the player.

I appreciate your patience with me on this. You are so kind.
Puppii
Posts: 20
Joined: Tue Jun 06, 2023 6:57 pm

Re: How to End Conversations?

Post by Puppii »

I followed the quick start guide again, and I'm still having the same issues.
I even tried using the Demo Database, thinking that it was an issue with the way I had set up my database, but I'm having the same problems.

I'm thinking it must be something I have set on my player or NPC or the NPC conversation zone I've set up.
I have a dialogue actor component on each of the prefabs, and the correct database and actors are assigned to each.
I have a child of each NPC (01 and 02) with a box collider, a Conversation Zone, and a Dialogue System Trigger set to On Use that references the database and conversation.

The player character prefab has the following components: Dialogue Actor (I also made sure this is set to the correct database and actor), Dialogue System Events (to disable player control on conversation start and enable it on conversation end) and also two dialogue system triggers one for conversation start and one for conversation end) with the sequence "AnimaotrPlay(idle)@0.1;" in both.

Again it's like the player character is not engaging in the conversation after it first starts, the Dialogue system events and the dialogue system triggers don't activate.

When the player and NPC were reversed in the conversation, those events and triggers did work on the player.
I'm so confused.
User avatar
Tony Li
Posts: 22106
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to End Conversations?

Post by Tony Li »

Try these settings:

Here we have 2 actors -- Player and NPC_01:

Puppii1.png
Puppii1.png (16.56 KiB) Viewed 989 times

You can see in the lower right that the conversation uses Player as the actor and NPC_01 as the conversant:

Puppii2.png
Puppii2.png (30.77 KiB) Viewed 989 times

The Dialogue Manager uses the Focus Template Standard Dialogue UI:

Puppii3.png
Puppii3.png (38 KiB) Viewed 989 times

NPC_01 has a ConversationZone child GameObject. The Conversation Zone component's Dialogue System section is configured like this:

Puppii4a.png
Puppii4a.png (18.54 KiB) Viewed 989 times

The Dialogue System Trigger plays the conversation and leaves the Conversation Actor & Conversation Conversant fields unassigned. The Dialogue Actor is set to NPC_01, and it uses the default subtitle panel & menu panel:

Puppii4b.png
Puppii4b.png (93.37 KiB) Viewed 989 times
User avatar
Tony Li
Posts: 22106
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to End Conversations?

Post by Tony Li »

When the conversation starts, the NPC speaks, and the NPC is focused on the right:

Puppii5a.png
Puppii5a.png (141.15 KiB) Viewed 988 times

When the player response menu appears, the player is focused on the left:

Puppii5b.png
Puppii5b.png (147.53 KiB) Viewed 988 times

When the player clicks the response and the NPC says its second line, the NPC gets focus again:

Puppii5c.png
Puppii5c.png (138.2 KiB) Viewed 988 times
Puppii
Posts: 20
Joined: Tue Jun 06, 2023 6:57 pm

Re: How to End Conversations?

Post by Puppii »

Oh my gosh, thank you so much for taking the time to document all these steps.
I will try this out as soon as I can and report back.
Post Reply