I'm putting together a quest that upon completion (success state) a GameObject will appear in the Scene and stay there for the duration of the gameplay. I am also using the Dialogue System to handle the quest conversation.
I've tried to accomplish this in two ways: Enable a GameObject (that is currently disabled in the Scene) and also by Instantiating the GameObject prefab. Enable GameObject appears to work early in the Quest (like during the Start state) but will not work in the success state.
The quest does go to another scene (a quick cut scene) and then comes back to the original scene of the quest. There is an error warning:
Code: Select all
Save System: No DataSerializer found on Save System. Adding JsonDataSerializer.
Quest Machine: GetQuestState(blueCrystal): Couldn't find a quest with ID 'blueCrystal'.
UnityEngine.Debug:LogWarning(Object)
I do have the save system in place. On my Saving System, which is a persistent object, I do have the Json Data Serializer. When the other scene loads (after the first scene quest has started), the No DataSerializer alert does appear. If I pause, I can see in the DontDestroyOnLoad the Json Data Serializer component attached to my Save System though. The HUD continues to display the correct info, and then the game returns to the previous scene.
Then I get the Quest Machine error couldn't find quest with ID blueCrystal. However, the quest does continue properly to the completion state (journal updates correctly as well). The HUD shows the correct state throughout the scene changes.
My custom Saving System script includes the following lines for Capture and Restore:
Code: Select all
string s = PixelCrushers.SaveSystem.Serialize(PixelCrushers.SaveSystem.RecordSavedGameData());
state["questMachine"] = s;
PixelCrushers.SaveSystem.ApplySavedGameData(PixelCrushers.SaveSystem.Deserialize<SavedGameData>(s));
- How do I get a gameObject to appear and stay after the completion of a quest?
- How do I fix the alert issues?