Page 1 of 1

How to save without using save system?

Posted: Sat Oct 26, 2024 3:42 am
by hhyu
I have a custom save system, so I don't want to use the default save system. I noticed that the Dialogue System supports Dialogue Database-Only Save. Similarly, I would like to ask how to save only the quest system's data without saving the entire system. :?: :?: :?:

Re: How to save without using save system?

Posted: Sat Oct 26, 2024 10:42 am
by Tony Li
Hi,

It's just one line of code to save, one line of code to restore. Set up the save system savers, and to save to a string or object:

Code: Select all

string s = SaveSystem.Serialize(SaveSystem.RecordSavedGameData());
//or:
SavedGameData data = SaveSystem.RecordSavedGameData();
Then save that to your save system.

To restore:

Code: Select all

SaveSystem.ApplySavedGameData(SaveSystem.Deserialize<SavedGameData>(s));
Untick the SaveSystem component's Save Current Scene checkbox since your save system will presumably take care of that.