Save System marking in-progress quests as deleted
Posted: Wed Sep 01, 2021 7:08 pm
Hi there,
We recently started setting up the Save System for use with Quest Machine, and we've hit a snag trying to save and restore quests.
When the scene starts, if we immediately save, all of the quests appear in the save data under the staticQuestIds section as expected:
"m_sceneName": "GlobalScene",
"m_list": [
{
"key": "Hephaestus_Forge_QuestGiver",
"sceneIndex": -1,
"data": "{\n \"staticQuestIds\": [\n \"Hephaestus_Forge-FindIron\"\n ],\n \"staticQuestData\": [\n {\n \"bytes\": [\n 0,\n 2,\n 0,\n 0,\n 0,\n 12,\n 123,\n 81,\n 85,\n 69,\n 83,\n 84,\n 71,\n 73,\n 86,\n 69,\n 82,\n 125,\n 31,\n 72,\n 101,\n 112,\n 104,\n 97,\n 101,\n 115,\n 116,\n 117,\n 115,\n 32,\n 116,\n 104,\n 101,\n 32,\n 71,\n 111,\n 100,\n 32,\n 111,\n 102,\n 32,\n 116,\n 104,\n 101,\n 32,\n 70,\n 111,\n 114,\n 103,\n 101,\n 14,\n 123,\n 81,\n 85,\n 69,\n 83,\n 84,\n 71,\n 73,\n 86,\n 69,\n 82,\n 73,\n 68,\n 125,\n 16,\n 72,\n 101,\n 112,\n 104,\n 97,\n 101,\n 115,\n 116,\n 117,\n 115,\n 95,\n 70,\n 111,\n 114,\n 103,\n 101,\n 16,\n 72,\n 101,\n 112,\n 104,\n 97,\n 101,\n 115,\n 116,\n 117,\n 115,\n 95,\n 70,\n 111,\n 114,\n 103,\n 101,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0\n ]\n }\n ],\n \"proceduralQuests\": [],\n \"deletedStaticQuests\": []\n}"
}..."
However, as soon as this QuestGiver gives his quest, and I save again, the quest now appears in deletedStaticQuests:
"m_sceneName": "GlobalScene",
"m_list": [
{
"key": "Hephaestus_Forge_QuestGiver",
"sceneIndex": -1,
"data": "{\n \"staticQuestIds\": [],\n \"staticQuestData\": [],\n \"proceduralQuests\": [],\n \"deletedStaticQuests\": [\n \"Hephaestus_Forge-FindIron\"\n ]\n}"
},..."
I noticed that GiveQuestToQuester() actually calls DeleteQuest() internally, so maybe this is the desired behavior. If so, how do you save the progress of an in-progress quest?
As a side note, we're not using the save system's scene loading system but are instead applying the data directly like this:
var saveData = SaveSystem.storer.RetrieveSavedGameData(0);
SaveSystem.ApplySavedGameData(saveData);
For saving the data we're calling:
SaveSystem.SaveToSlot(0);
We recently started setting up the Save System for use with Quest Machine, and we've hit a snag trying to save and restore quests.
When the scene starts, if we immediately save, all of the quests appear in the save data under the staticQuestIds section as expected:
"m_sceneName": "GlobalScene",
"m_list": [
{
"key": "Hephaestus_Forge_QuestGiver",
"sceneIndex": -1,
"data": "{\n \"staticQuestIds\": [\n \"Hephaestus_Forge-FindIron\"\n ],\n \"staticQuestData\": [\n {\n \"bytes\": [\n 0,\n 2,\n 0,\n 0,\n 0,\n 12,\n 123,\n 81,\n 85,\n 69,\n 83,\n 84,\n 71,\n 73,\n 86,\n 69,\n 82,\n 125,\n 31,\n 72,\n 101,\n 112,\n 104,\n 97,\n 101,\n 115,\n 116,\n 117,\n 115,\n 32,\n 116,\n 104,\n 101,\n 32,\n 71,\n 111,\n 100,\n 32,\n 111,\n 102,\n 32,\n 116,\n 104,\n 101,\n 32,\n 70,\n 111,\n 114,\n 103,\n 101,\n 14,\n 123,\n 81,\n 85,\n 69,\n 83,\n 84,\n 71,\n 73,\n 86,\n 69,\n 82,\n 73,\n 68,\n 125,\n 16,\n 72,\n 101,\n 112,\n 104,\n 97,\n 101,\n 115,\n 116,\n 117,\n 115,\n 95,\n 70,\n 111,\n 114,\n 103,\n 101,\n 16,\n 72,\n 101,\n 112,\n 104,\n 97,\n 101,\n 115,\n 116,\n 117,\n 115,\n 95,\n 70,\n 111,\n 114,\n 103,\n 101,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0\n ]\n }\n ],\n \"proceduralQuests\": [],\n \"deletedStaticQuests\": []\n}"
}..."
However, as soon as this QuestGiver gives his quest, and I save again, the quest now appears in deletedStaticQuests:
"m_sceneName": "GlobalScene",
"m_list": [
{
"key": "Hephaestus_Forge_QuestGiver",
"sceneIndex": -1,
"data": "{\n \"staticQuestIds\": [],\n \"staticQuestData\": [],\n \"proceduralQuests\": [],\n \"deletedStaticQuests\": [\n \"Hephaestus_Forge-FindIron\"\n ]\n}"
},..."
I noticed that GiveQuestToQuester() actually calls DeleteQuest() internally, so maybe this is the desired behavior. If so, how do you save the progress of an in-progress quest?
As a side note, we're not using the save system's scene loading system but are instead applying the data directly like this:
var saveData = SaveSystem.storer.RetrieveSavedGameData(0);
SaveSystem.ApplySavedGameData(saveData);
For saving the data we're calling:
SaveSystem.SaveToSlot(0);