Dismiss current conversation
-
- Posts: 14
- Joined: Tue Apr 11, 2017 1:59 pm
Dismiss current conversation
Currently, when I have conversation triggered by OnEnable, the dialogue started remains with the UI even if a new conversation is triggered. How do I explicitly dismiss a conversation either in code or via a Unity Event?
Re: Dismiss current conversation
Hi,
I assume you've ticked the option to allow simultaneous conversations, right? Otherwise it shouldn't allow the new conversation to start while the old one is active.
You can call DialogueManager.StopConversation() to stop the old conversation before starting the new one.
That's the preferred way to do it. If you need to dig into a list of active conversations, you can access DialogueManager.Instance.ActiveConversationRecords, which is a list of ActiveConversationRecord objects. To end a specific conversation, call its ConversationController property's Close method.
I assume you've ticked the option to allow simultaneous conversations, right? Otherwise it shouldn't allow the new conversation to start while the old one is active.
You can call DialogueManager.StopConversation() to stop the old conversation before starting the new one.
That's the preferred way to do it. If you need to dig into a list of active conversations, you can access DialogueManager.Instance.ActiveConversationRecords, which is a list of ActiveConversationRecord objects. To end a specific conversation, call its ConversationController property's Close method.
-
- Posts: 14
- Joined: Tue Apr 11, 2017 1:59 pm
Re: Dismiss current conversation
I had not but I'll look into that.
And this is exactly what I was looking for. I see there are other functions as well that I can call from an event.
Thank you.
And this is exactly what I was looking for. I see there are other functions as well that I can call from an event.
Thank you.
-
- Posts: 14
- Joined: Tue Apr 11, 2017 1:59 pm
Re: Dismiss current conversation
Is it advisable to bypass the conversation trigger altogether and simply use Unity Events to trigger conversations?
Re: Dismiss current conversation
It's up to you. Ultimately they both call DialogueManager.StartConversation(). Conversation Triggers have built in Conditions, though, which can be handy.
-
- Posts: 14
- Joined: Tue Apr 11, 2017 1:59 pm
Re: Dismiss current conversation
As always, Tony, thanks for the quick and sound advice. You've been a big help. 

Re: Dismiss current conversation
Glad to help!
Putting a related question out there for everyone: Is there any demand for a version of DialogueManager.StopConversation() that takes a specific conversation title? Such as:
Putting a related question out there for everyone: Is there any demand for a version of DialogueManager.StopConversation() that takes a specific conversation title? Such as:
Code: Select all
DialogueManager.StopConversation("Politics at Dinner");
-
- Posts: 112
- Joined: Tue Jan 19, 2016 11:37 pm
Re: Dismiss current conversation
Would that help with stopping one of simultaneous conversations?
Re: Dismiss current conversation
Yes, as long as you can distinguish the conversations by their titles. If you've started two conversations with the same title, I'd probably program it so that both of them are stopped.hellwalker wrote:Would that help with stopping one of simultaneous conversations?
-
- Posts: 14
- Joined: Tue Apr 11, 2017 1:59 pm
Re: Dismiss current conversation
Is the current Stop() the equivalent of a StopAll()?