Page 1 of 1

Remind players of new conversations

Posted: Wed Oct 06, 2021 7:26 am
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

Re: Remind players of new conversations

Posted: Wed Oct 06, 2021 9:04 am
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();
    }
}