Page 1 of 1

Check if dialogue Line has been said?

Posted: Sat Apr 13, 2024 2:51 pm
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?

Re: Check if dialogue Line has been said?

Posted: Sat Apr 13, 2024 8:36 pm
by Tony Li
Hi,

Yes; there's a built-in registry called SimStatus that you can enable.

Re: Check if dialogue Line has been said?

Posted: Sun Apr 14, 2024 4:11 pm
by lordzeon
I see the reference only mention SimStatus for LUA, there is any way i can check that from code?

Re: Check if dialogue Line has been said?

Posted: Sun Apr 14, 2024 6:52 pm
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.
}