Remind players of new conversations

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Tony Chou
Posts: 7
Joined: Wed Jun 23, 2021 11:39 pm

Remind players of new conversations

Post by Tony Chou »

I would like to show dialogue icon on NPC, whenever player unlock a new conversation. So I
write my script by getting variable from DialogueLua to judge showing icon or not. But when I need to change the conversation occurrence conditions, I need to modify both my script and the conversation tree in the database.Is there a better way to accomplish this feature?
Image
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Remind players of new conversations

Post by Tony Li »

Hi,

To check if a conversation now has valid entries to show, use DialogueManager.ConversationHasValidEntry(). Example:

Code: Select all

public void EnterCave()
{
    // Set a Dialogue System variable that the conversation's conditions will check:
    DialogueLua.SetVariable("Has Torch", hasTorch);
    
    // If the conversation now has conditions that are true, show the icon:
    if (DialogueManager.ConversationHasValidEntry("Dark Cave Conversation"))
    {
        ShowDialogueIcon();
    }
}
Post Reply