Page 1 of 1

Questions about saving

Posted: Tue Jul 25, 2023 6:28 am
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 :)

Re: Questions about saving

Posted: Tue Jul 25, 2023 8:40 am
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();

Re: Questions about saving

Posted: Tue Jul 25, 2023 9:38 am
by lostmushroom
Awesome thanks Tony!

Re: Questions about saving

Posted: Tue Jul 25, 2023 9:48 am
by Tony Li
Happy to help!