Questions about saving

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Questions about saving

Post by lostmushroom »

Hey Tony, I'm a bit stuck figuring out saving with DS. The game I've made only takes 10 minutes to play, so I'm thinking it's best to disable saving all together and have the game reset all variables on quit to main menu, but I'm not sure how to get this working.

I haven't added a Save System or DS Saver to my Dialogue Manager, but the variables are still being saved after scene changes. Is there something else that saves the dialogue database on scene change?

I set Record Persistent Data to No Game Objects, so everything else in the gameplay scene is being reset - it's just getting the database to reset I need to figure out.

Thanks :)
User avatar
Tony Li
Posts: 22119
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions about saving

Post by Tony Li »

Hi,

If you're using Saver components such as PositionSaver and EnabledSaver to remember things across scenes changes, then make sure your Dialogue Manager has a DialogueSystemSaver component, and use this line of C# code when returning to the main menu:

Code: Select all

PixelCrushers.SaveSystem.ResetGameState();
If you're not using Saver components, then when returning to the main menu use this line of C# code:

Code: Select all

PixelCrushers.DialogueSystem.DialogueManager.ResetDatabase();
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Re: Questions about saving

Post by lostmushroom »

Awesome thanks Tony!
User avatar
Tony Li
Posts: 22119
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions about saving

Post by Tony Li »

Happy to help!
Post Reply