Hello there,
I saw that there was a priority system between entries in the same conversation. I was wondering if there was a priority system between the conversations themselves?
There is an option in the DialogueSystemController "interruptActiveConversations" that lets you interrupt an active conversation. I'd like to be able to interrupt it only if the new conversation has a higher priority than the current one.
Is this possible?
What would be the best way to do this?
Thanks a lot for your help!
Interrupt conversation with lower priority
Re: Interrupt conversation with lower priority
Hi,
There isn't anything built in. However, the Dialogue System is easily extended. You can add a custom field to your conversation template (see Templates) to specify priority. Then, if you're using Dialogue System Trigger components, override the DoConversationAction() method. For example, if your conversations have a custom Number field named "Priority", you could make a subclass of DialogueSystemTrigger similar to this:
There isn't anything built in. However, the Dialogue System is easily extended. You can add a custom field to your conversation template (see Templates) to specify priority. Then, if you're using Dialogue System Trigger components, override the DoConversationAction() method. For example, if your conversations have a custom Number field named "Priority", you could make a subclass of DialogueSystemTrigger similar to this:
Code: Select all
public class PrioritizedDialogueSystemTrigger : DialogueSystemTrigger
{
protected override void DoConversationAction(Transform actor)
{
if (DialogueManager.isConversationActive)
{
var currentConversation = DialogueManager.masterDatabase.GetConversation(DialogueManager.lastConversationStarted);
var newConversation = DialogueManager.masterDatabase.GetConversation(conversation);
if (currentConversation.LookupInt("Priority") > newConversation.LookupInt("Priority"))
{
return; // Current conversation's priority is higher, so don't start new one.
}
}
base.DoConversationAction(actor);
}
}
Re: Interrupt conversation with lower priority
This looks exactly like what I needed. Thank you a lot
Re: Interrupt conversation with lower priority
Glad to help!