Hello,
Is there a way to check if a conversation has been forced stopped (by calling DialogueManager.StopAllConversations();) or if it has come to an end by its own because it reached the end of the conversation?
I'm listening to DialogueManager.instance.conversationEnded but it is called in both cases.
Any idea?
Thank you
Distinguish conversation force stop and conversation end
Re: Distinguish conversation force stop and conversation end
Hi,
There's no distinction. The only distinction is if you use the Dialogue Manager's Input Settings > Cancel Conversation Input to cancel a conversation, which does invoke OnConversationCancelled.
If you're calling DialogueManager.StopAllConversations() in your own script, you could handle it in the same method that calls DialogueManager.StopAllConversations().
If it's happening in a Dialogue System Trigger because the Replace checkbox is ticked, you could make a subclass of DialogueSystemTrigger that overrides DoConversationAction() to check if another conversation is active:
There's no distinction. The only distinction is if you use the Dialogue Manager's Input Settings > Cancel Conversation Input to cancel a conversation, which does invoke OnConversationCancelled.
If you're calling DialogueManager.StopAllConversations() in your own script, you could handle it in the same method that calls DialogueManager.StopAllConversations().
If it's happening in a Dialogue System Trigger because the Replace checkbox is ticked, you could make a subclass of DialogueSystemTrigger that overrides DoConversationAction() to check if another conversation is active:
Code: Select all
public class MyDialogueSystemTrigger : DialogueSystemTrigger
{
protected override void DoConversationAction(Transform actor)
{
if (DialogueManager.isConversationActive && replace) { /* your code here */ }
base.DoConversationAction(actor);
}
}