How do you reset Sim Status?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

How do you reset Sim Status?

Post by Abelius »

Hi there,

I've looked for this in the forum and the manual but could find anything specific (as the search feature of the manual doesn't even return results with "sim status").

I need to reset Sim Status values for ALL conversations. I plan to run this action when running a "Quit to Main Menu" button.

Is there any straightforward method to achieve this?

Thank you!
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: How do you reset Sim Status?

Post by Tony Li »

Will it work for you to reset the entire database? This includes SimStatus as well as current variable values, etc. To do this, use DialogueManager.ResetDatabase() in a script, or use the equivalent visual scripting action (e.g., in PlayMaker).
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Re: How do you reset Sim Status?

Post by Abelius »

Thank you Tony. I didn't notice that method.

My problem now it's that if I call that method twice, the second time the PlayMaker action is run, it can't find the instance of the database, probably due to Adventure Creator resetting "something".

I'll try to run it as a pure script at OnStart and see if that way it's able to find itself. :P
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: How do you reset Sim Status?

Post by Tony Li »

If that doesn't do the trick, please post the error message you're getting. I may be able to suggest a solution.
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Re: How do you reset Sim Status?

Post by Abelius »

It has worked using a plain script.

I suspect PlayMaker isn't able to find the instance a second time because Dialogue Manager is put into Don't Destroy on Load...

Image

...AND Adventure Creator does something strange when using its own 'Restart Game' action.

But I wouldn't know, as I'm no programmer in the first place. :?

Anyway, this other way of executing the method is working fine.

Thank you for your support.
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: How do you reset Sim Status?

Post by Tony Li »

Happy to help! Glad it's working now.
Post Reply