Check if dialogue Line has been said?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
lordzeon
Posts: 12
Joined: Mon Feb 26, 2024 5:06 pm

Check if dialogue Line has been said?

Post by lordzeon »

Im working on procedurally generating things in my game and i would like to know if a specific dialogue line from a specific conversation has been said already at least once. I understand i could be adding a SendMessage on that node and then listen for the message, or setting a variable there, but there is any registry i could just check if it has been said at runtime?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Check if dialogue Line has been said?

Post by Tony Li »

Hi,

Yes; there's a built-in registry called SimStatus that you can enable.
lordzeon
Posts: 12
Joined: Mon Feb 26, 2024 5:06 pm

Re: Check if dialogue Line has been said?

Post by lordzeon »

I see the reference only mention SimStatus for LUA, there is any way i can check that from code?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Check if dialogue Line has been said?

Post by Tony Li »

Yes, use DialogueLua.GetSimStatus(). Example:

Code: Select all

if (DialogueLua.GetSimStatus(someDialogueEntry) == DialogueLua.WasDisplayed)
{
    // someDialogueEntry has been said.
}
or:

Code: Select all

// Find a dialogue entry with Title "Quest Accepted" in conversation "Kill Rats":
var conversation = DialogueManager.masterDatabase.GetConversation("Kill Rats");
var dialogueEntry = conversation.dialogueEntries.Find(entry => entry.Title == "Quest Accepted");
if (DialogueLua.GetSimStatus(dialogueEntry) == DialogueLua.WasDisplayed)
{
    // someDialogueEntry has been said.
}
Post Reply