A quick question about saves

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Yubaba
Posts: 38
Joined: Thu Oct 08, 2020 9:37 pm

A quick question about saves

Post by Yubaba »

Hi Tony,
I really appreciate being able to lean on DS's save slot system but I have my own scene loader. I just wanted to check that this process is okay and I'm not missing anything, it seems to be working great, but I've only just implemented it -

Saving is called by

Code: Select all

PixelCrushers.SaveSystem.SaveToSlot(_slot);
In the main menu I'm clearing all data -

Code: Select all

DialogueManager.instance.ResetDatabase();
DialogueSystemInkIntegration.instance.ResetStories();
and then Loading is

Code: Select all

var _loadData = PixelCrushers.SaveSystem.storer.RetrieveSavedGameData(_slot);
PixelCrushers.SaveSystem.ApplySavedGameData(_loadData);
var _sceneToLoad = DialogueLua.GetVariable(SceneToLoad).asString;
MyCustomSceneLoader(_sceneToLoad);
thanks so much for all your hard work,

Pete.
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: A quick question about saves

Post by Tony Li »

Hi Pete,

For saving and loading, untick the Save System component's Save Current Scene checkbox. Then use PixelCrushers.SaveSystem.SaveToSlot(_slot) as you're already doing, PixelCrushers.SaveSystem.LoadFromSlot(_slot) to load and apply saved game data, and PixelCrushers.SaveSystem.ResetGameState() to clear all data in the main menu. If you add an InkSaver component to your Dialogue Manager, you don't need to call DialogueSystemInkIntegration.instance.ResetStories().

For scene changes using your own scene loader, I recommend the method shown in code at the bottom of How To: Change Scenes With Save System.
Yubaba
Posts: 38
Joined: Thu Oct 08, 2020 9:37 pm

Re: A quick question about saves

Post by Yubaba »

Done! Thank you!
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: A quick question about saves

Post by Tony Li »

Glad to help!
Post Reply