Page 1 of 1

Reset SimStatus of a whole conversation?

Posted: Fri Mar 17, 2017 12:59 pm
by NyxGen
Our game has a system in place where a player can basically "fail" a conversation, and will be reset back to the beginning of the conversation. However, after this "reset", the SimStatus values for all of the dialog nodes previously visited are now set to "WasDisplayed" and such, instead of "Untouched".

Is there a way to tell the Dialogue System to just completely reset all SimStatus values for a given conversation? I found DialogueLua.MarkDialogueEntry(), which is only referenced by DialogueLua.MarkDialogueEntryDisplayed() and DialogueLua.MarkDialogueEntryOffered(), but for some reason there is no DialogueLua.MarkDialogueEntryUntouched()... Am I going to have to modify the source code to achieve this? I'm okay with doing this, if necessary, I just don't want to overlook another method that already exists to achieve what I want..

Re: Reset SimStatus of a whole conversation?

Posted: Fri Mar 17, 2017 1:42 pm
by Tony Li
Hi,

You don't have to modify the source. Since SimStatus is stored in the Lua environment, you can use Lua.Run() to set the Lua variable Conversation[x].Dialog[y].SimStatus to "Untouched", where x is the conversation ID and y is the dialogue entry ID. For example:

Code: Select all

void MarkDialogueEntryUntouched(DialogueEntry entry) {
    Lua.Run("Conversation[" + entry.conversationID + "].Dialog[" + entry.id + "].SimStatus = 'Untouched'");
}

Re: Reset SimStatus of a whole conversation?

Posted: Fri Mar 17, 2017 1:48 pm
by NyxGen
Ah yes. I actually ended up writing almost exactly that method, however I _did_ modify the source so as to keep it alongside the other similarly named methods, and just made a note of it for if I ever perform an update to the plugin for this project.

Thanks for the info!

Re: Reset SimStatus of a whole conversation?

Posted: Fri Mar 17, 2017 2:23 pm
by Tony Li
I also just made a note to add this to the source for completeness in the next version.