Saving, loading on scene change
-
- Posts: 12
- Joined: Tue Dec 22, 2020 2:43 pm
Saving, loading on scene change
Hi, Sorry to ask another question
I have set up the save system and seems to work from the main game scene, i can end play mode and run again and everything is saved fine, but if i change to the main menu then click on continue game, it then just loads the scene nothing is loaded, but if i end and play again all the save data is back, is there something stopping it from loading because its a scene change and not starting from play?
thanks.
I have set up the save system and seems to work from the main game scene, i can end play mode and run again and everything is saved fine, but if i change to the main menu then click on continue game, it then just loads the scene nothing is loaded, but if i end and play again all the save data is back, is there something stopping it from loading because its a scene change and not starting from play?
thanks.
Re: Saving, loading on scene change
Hi,
How are you saving and loading? Are you using an AutoSaveLoad component?
How are you continuing? Loading a saved game? (e.g., SaveSystem.LoadFromSlot(0);)
How are you saving and loading? Are you using an AutoSaveLoad component?
How are you continuing? Loading a saved game? (e.g., SaveSystem.LoadFromSlot(0);)
-
- Posts: 12
- Joined: Tue Dec 22, 2020 2:43 pm
Re: Saving, loading on scene change
Yes i am using the autosave function, when you continue game it just loads the scene as normal then easy save kicks in and applies all the properties.
Re: Saving, loading on scene change
How are you tying EasySave and Quest Machine's save system into the whole save process. (Apologies if you've described it before. It's hard to remember what every dev is doing in their projects.)
-
- Posts: 12
- Joined: Tue Dec 22, 2020 2:43 pm
Re: Saving, loading on scene change
Not a problem, i am using a empty gameobject with all the save systems the autosave and the save and json components then the es3 component you send me, it does work just not when changing scenes. i have not added any scripting for quest machine.
I have scripted in the save on application quit, but the save system work when i change scene just not the journal.
I have scripted in the save on application quit, but the save system work when i change scene just not the journal.
Re: Saving, loading on scene change
Are you changing scenes using one of the save system-aware methods? They are:
- Scene Portal component
- SaveSystemMethods component's LoadScene method
- In C#: PixelCrushers.SaveSystem.LoadScene()
- Or, if you're using the Dialogue System, the LoadLevel() sequencer command
-
- Posts: 12
- Joined: Tue Dec 22, 2020 2:43 pm
Re: Saving, loading on scene change
No i am not using any of them.
Re: Saving, loading on scene change
Hi,
You will either need to use one of those methods or this:
Before changing the scene, call this C# code:
After changing the scene, call this C# code:
You will either need to use one of those methods or this:
Before changing the scene, call this C# code:
Code: Select all
PixelCrushers.SaveSystem.BeforeSceneChange();
PixelCrushers.SaveSystem.RecordSavedGameData();
Code: Select all
PixelCrushers.SaveSystem.ApplySavedGameData();
-
- Posts: 12
- Joined: Tue Dec 22, 2020 2:43 pm
Re: Saving, loading on scene change
that works perfect thank you, does the below still work with es3 or do i need to use another method to delete the save file.
DeleteSavedGameData()
because i am using slot 1 for the save and its not deleting it with this.
Debug.Log("Save exists / Deleting");
ES3.DeleteFile("SaveFile.es3");
ES3.Save("saveExists", saveExists);
PixelCrushers.SaveSystem.DeleteSavedGameInSlot(1);
Loader.Load(Loader.Scene.Main_Game_SinglePlayer);
DeleteSavedGameData()
because i am using slot 1 for the save and its not deleting it with this.
Debug.Log("Save exists / Deleting");
ES3.DeleteFile("SaveFile.es3");
ES3.Save("saveExists", saveExists);
PixelCrushers.SaveSystem.DeleteSavedGameInSlot(1);
Loader.Load(Loader.Scene.Main_Game_SinglePlayer);
-
- Posts: 12
- Joined: Tue Dec 22, 2020 2:43 pm
Re: Saving, loading on scene change
Its ok sorted it thanks again for the help.