Setting a quest field in code doesn't save

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
bluebuttongames
Posts: 91
Joined: Tue Jul 14, 2015 8:22 am

Setting a quest field in code doesn't save

Post by bluebuttongames »

Hi guys,

So I have this somewhere in my code:

questName (string)
dayToSetCompleted (int)

DialogueLua.SetQuestField(questName,"DayCompleted",dayToSetCompleted);

That get's called, and locally when I report that value it returns correctly, however that doesn't seem to save like variables do. When I change scene that field hasn't been saved.

I'm saving on level exit like this:

string dbData = PersistentDataManager.GetSaveData();
PlayerPrefs.SetString(currentDBSaveSlot,dbData);

Where am I going wrong here?

Thanks,

BB
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: Setting a quest field in code doesn't save

Post by Tony Li »

Hi,

To minimize saved game sizes, by default only quest states and quest entry states are saved. To save other fields, inspect the Dialogue Manager and tick Persistent Data Settings > Include All Item & Quest Data. Alternatively, you can assign a delegate method to PersistentDataManager.GetCustomSaveData(), but that's a more involved process.
bluebuttongames
Posts: 91
Joined: Tue Jul 14, 2015 8:22 am

Re: Setting a quest field in code doesn't save

Post by bluebuttongames »

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

Re: Setting a quest field in code doesn't save

Post by Tony Li »

Happy to help!
Post Reply