Stopping a Conversation in a Behavior Designer tree

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Ooghe
Posts: 8
Joined: Mon Oct 06, 2014 12:19 pm

Stopping a Conversation in a Behavior Designer tree

Post by Ooghe »

I’m probably missing something obvious, but I’ve been struggling to figure out how to complete a “Start Conversation” task I have running under a behavior tree on an npc character. I thought I’d post to the forum to see if anyone had any ideas.



I have a simple conversation, where at a certain point in the behavior tree, a Start Conversation task has the npc ask the Player “What would you like me to do?” and “This” or “That” are the Player’s only menu choices, and each one is marked '[END]'.



Despite this, I can’t actually get the Conversation to end (having checked the ‘wait for conversation to complete' box), so that the Behavior tree hangs at the Start Conversation task before moving on to the next task in the sequence.



I’ve compared my approach to the sample Behavior Designer/Dialogue Manager scene, and can’t see the difference- although if I swap databases my same behavior tree *is* able to behave differently.



It’s a mystery to me, as I would think the player selecting the line that has an [END] as a menu response would definitively end the conversation. One clue I have stumbled on, is that in the sample scene provided, ‘npc’ has IsPlayer set to ‘True’, whereas my npc has IsPlayer set to ‘false’ though switching that disrupts the order of the conversation.



If anyone has any thoughts, I’d be very grateful! Thanks!
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Stopping a Conversation in a Behavior Designer tree

Post by Tony Li »

Make sure the conversation participant with the behavior tree has a "Dialogue System Callback" component.



Try setting the Dialogue Manager's Debug Level to Info. This will log a lot to the console. Look for 'Dialogue System: Starting conversation...' when you start the conversation, and 'Dialogue System: Ending conversation.' when you select a line that has an [END]. If you see 'Ending conversation.', you know that the Dialogue System has ended the conversation.



When it ends the conversation, it sends an OnConversationEnd message to the Dialogue Manager and the participants. In the Behavior Designer/Dialogue System example scene, the npc GameObject has a Dialogue System Callback component. This component receives the OnConversationEnd message and informs Behavior Designer.



If this doesn't help, please feel free to email your project to tony (at) pixelcrushers.com. I'll be happy to take a look.


Ooghe
Posts: 8
Joined: Mon Oct 06, 2014 12:19 pm

Stopping a Conversation in a Behavior Designer tree

Post by Ooghe »

Thanks. The console is definitely showing that the conversation ends, so something in my setup must be somehow preventing the Dialogue System Callback from addressing Behavior Designer...
Ooghe
Posts: 8
Joined: Mon Oct 06, 2014 12:19 pm

Stopping a Conversation in a Behavior Designer tree

Post by Ooghe »

Somehow, I fixed it. Thanks!
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Stopping a Conversation in a Behavior Designer tree

Post by Tony Li »

I'm glad it's working now! If any other issues pop up, please feel free to send me an example project.
Post Reply