Page 1 of 1
Questions about Simultaneous Conversations
Posted: Sat Jun 10, 2017 9:25 pm
by hellwalker
Hi,
I managed to run two normal conversations by using override Display settings and two dialogue UI prefabs. But I have trouble focusing on continue state for each. Is there a way to disable continue for first conversation, and instead channel it to continue second conversation?
Second conversation is always same so I can know it's ID or Name.
Re: Questions about Simultaneous Conversations
Posted: Sun Jun 11, 2017 11:09 am
by Tony Li
hellwalker wrote:Hi,
I managed to run two normal conversations by using override Display settings and two dialogue UI prefabs. But I have trouble focusing on continue state for each. Is there a way to disable continue for first conversation, and instead channel it to continue second conversation?
Second conversation is always same so I can know it's ID or Name.
Simultaneous conversations were originally designed to support up to one player-involved conversation (e.g., with response menu, continue buttons, etc.) while other NPC-NPC conversations are active. It's still possible to run multiple player-involved conversations. This
Turn Based Multiple Conversation Example is an example of running four simultaneous conversations with four separate dialogue UIs.
But it doesn't use continue buttons. The default continue button behavior continues everything -- all active conversations. To continue a specific conversation, you'll need to call that conversation's ConversationView.OnConversationContinue() method.
For example, let's say your conversation's ID is in the variable convID. You can do something like this:
Code: Select all
// Find the active conversation record for our conversation:
var records = DialogueManager.Instance.ActiveConversations;
var record = records.Find(r => r.ConversationModel.FirstState.subtitle.dialogueEntry.conversationID == convID);
// Then call its View's OnConversationContinue to continue it:
record.ConversationView.OnConversationContinue();
Re: Questions about Simultaneous Conversations
Posted: Wed Jun 14, 2017 4:15 pm
by hellwalker
Thanks,
I think this works, but I have run into a second problem. When the second conversation finishes, it also seems to advance first conversation. Is there a way to prevent this?
Re: Questions about Simultaneous Conversations
Posted: Wed Jun 14, 2017 6:59 pm
by Tony Li
Here's an example (based on the previously-linked Turn Based Example) that uses continue buttons. It uses a short script named ConversationContinueButton that lets you configure a continue button to continue a specific conversation by ID. (Inspect each dialogue UI's "Subtitle Continue Button" to see how it's configured.)
ContinueSpecificConversationExample_2017-06-14.unitypackage
If that doesn't help, let me know how your situation is set up. I'll try to put together something similar.
Re: Questions about Simultaneous Conversations
Posted: Tue Oct 10, 2017 9:44 pm
by hellwalker
Hey, I recently updated the DS to newest one. Did something change in the way continue function targets conversations?
I was using the code sample you gave me above:
Code: Select all
// Find the active conversation record for our conversation:
var records = DialogueManager.Instance.ActiveConversations;
var record = records.Find(r => r.ConversationModel.FirstState.subtitle.dialogueEntry.conversationID == convID);
// Then call its View's OnConversationContinue to continue it:
record.ConversationView.OnConversationContinue();
But with update I had to supply dialogue UI to OnConversationContinue(), and now it does not advance the second conversation I targeted with ID.
Re: Questions about Simultaneous Conversations
Posted: Wed Oct 11, 2017 1:25 pm
by Tony Li
Hi,
Sorry; that change isn't documented very clearly. I try to minimize API changes, but this was one of the rare times it was necessary to make continue buttons only continue their specific conversation and not continue all conversations.
Update your script to call this method instead, which doesn't require you to specify a UI:
Code: Select all
record.ConversationView.OnConversationContinueAll();