How to save without using save system?

Announcements, support questions, and discussion for Quest Machine.
Post Reply
hhyu
Posts: 11
Joined: Fri Jul 05, 2024 9:31 am

How to save without using save system?

Post 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. :?: :?: :?:
User avatar
Tony Li
Posts: 22189
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to save without using save system?

Post 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.
Post Reply