Conversation Priorities

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
cungoliant
Posts: 7
Joined: Wed May 08, 2024 7:49 pm

Conversation Priorities

Post by cungoliant »

Hi, thanks for this great asset.

I have a question about conversation priorities.
I have a NPC prefab. It has Dialogue System Trigger that Barks on use with no condition.
This bark comes from GenericNPCGreet conversation that has generic texts such as "Hi", "Good day", "How are you?" etc.

By this, i wanted that; whenever player clicks (on use) on a Npc, he will not remain unanswered.

But, of course, some npc's have conversations or barks that gives quests or quest tips or something like that. These are naturally more important.
I added another Dialogue System Trigger component to these npcs that starts conversation or barks.

The problem is, although if a npc has an "important" bark, he barks from GenericNPCGreet.
Also, if a npc has a conversation, conversation starts but a warning in console says : Bark triggered, but a conversation is already active

Is it possible to do that; if npc has no other things to say (bark or conversation), bark from GenericNPCGreet?

Thanks in advance.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conversation Priorities

Post by Tony Li »

Hi,

Yes. It depends on how you will determine if the NPC has something to say. Let's say you have two conversations:
  • "Greetings": Generic barks
  • "NPC Dialogue": Conversation whose nodes that are linked from <START> have Conditions on them. It's possible that one or more nodes' Conditions may be true, in which is the conversation has something to say. If none of the nodes' Conditions are true, the NPC has nothing to say and should bark instead.
In this case, in C# you can check if DialogueManager.ConversationHasValidEntry("NPC Dialogue") is true. You could make a method like:

Code: Select all

bool HasSomethingToSay(string conversationTitle)
{
    return DialogueManager.ConversationHasValidEntry(conversationTitle);
}
Then register that method with Lua.

Then you can set the bark Dialogue System Trigger's Conditions > Lua Conditions to:

Code: Select all

HasSomethingToSay("NPC Dialogue") == false
cungoliant
Posts: 7
Joined: Wed May 08, 2024 7:49 pm

Re: Conversation Priorities

Post by cungoliant »

Thank you very much Tony
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conversation Priorities

Post by Tony Li »

Glad to help!
Post Reply