How to get notified when a conversation ends?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
MaddoScientisto
Posts: 1
Joined: Thu Nov 09, 2017 3:20 am

How to get notified when a conversation ends?

Post by MaddoScientisto »

I just started using Dialogue System, when I want to start a conversation first I disable the input, then I start the conversation with DialogueManager.StartConversation(_conversationName);

But it seems I have no known way to know when the conversation ends and enable the input, I tried checking out OnConversationEnd but I can't seem to figure out the API I need, what can I do to?

Edit: I tried registering lua functions for that and I sort of got close to what I want to do but I can't really find a good way to trigger the input unlock script after the last node rather than ON it

Edit2: the Dialogue System Events component on the dialogue manager seems to be doing what I need, I just needed to link it to my game manager
User avatar
Tony Li
Posts: 22655
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to get notified when a conversation ends?

Post by Tony Li »

Hi,

Sounds like you're all set now. Here's more info if you're interested. Under the hood, the Dialogue System Events component listens for the OnConversationEnd message. The Dialogue System sends this message to the Dialogue Manager GameObject and both primary participants (i.e., the GameObjects assigned to the Conversation Trigger's Actor and Conversant fields) as described on the Script Messages page.

If you want to cut out the middle man (Dialogue System Events), you can put your script on the Dialogue Manager -- or the player -- and add an OnConversationEnd(Transform) method to it.

Or, if you don't want to do any scripting at all, you can add a Set Component Enabled On Dialogue Event component to your player. Set the Trigger to OnConversation, and assign your input script(s) to the OnStart and OnEnd sections.
Post Reply