Reset SimStatus of a whole conversation?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
NyxGen
Posts: 9
Joined: Tue Apr 28, 2015 3:15 pm

Reset SimStatus of a whole conversation?

Post 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..
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Reset SimStatus of a whole conversation?

Post 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'");
}
NyxGen
Posts: 9
Joined: Tue Apr 28, 2015 3:15 pm

Re: Reset SimStatus of a whole conversation?

Post 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!
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Reset SimStatus of a whole conversation?

Post by Tony Li »

I also just made a note to add this to the source for completeness in the next version.
Post Reply