if (ORK.SaveGame.FileExists(0))
{
DataObject data = ORK.SaveGame.LoadFile(0);
playerCombatant = new Combatant(data, false, ORK.Game.ActiveGroup);
Debug.Log("Loaded Game from Slot 0");
}
else
{
// No previous saved game so create a new combatant.
playerCombatant = ORK.Combatants.Create(
0, ORK.Game.ActiveGroup, false, false);
playerCombatant.Init();
}
// Mutate the data slightly.
Debug.Log("PlayerCombatant:" + playerCombatant.Status.Level);
Debug.Log("PlayerCombatant:" + playerCombatant.Status.LevelUp());
Debug.Log("PlayerCombatant:" + playerCombatant.Status.Level);
// Save to slot 0.
// Next time the game runs, I expect the ORK.SaveGame.FileExists(0) call to return true
ORK.SaveGame.Save(0);
NullReferenceException: Object reference not set to an instance of an object
ORKFramework.SaveGameChoice.SavedGame () (at <8fa1d1597e124b05acdf108d7df8f4b0>:0)
ORKFramework.SaveGameHandler.Save (System.Int32 index) (at <8fa1d1597e124b05acdf108d7df8f4b0>:0)
MyNamespace.CustomLevelManager.Start () (at Assets/Scripts/CustomLevelManager.cs:52)
It looks like you're new here. If you want to get involved, click one of these buttons!
Does this also happen when no save file exists?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!