Page 1 of 1

Setting a quest field in code doesn't save

Posted: Wed Sep 12, 2018 11:58 am
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

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

Posted: Wed Sep 12, 2018 3:01 pm
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.

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

Posted: Thu Sep 13, 2018 12:41 pm
by bluebuttongames
Thank you!

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

Posted: Thu Sep 13, 2018 1:40 pm
by Tony Li
Happy to help!