Hey Gil,

I was looking into a Hardcore Difficulty. When you die, it tells you your character has died, and his save file data has been erased then ends your game and puts you back to Main Menu.

This all works. My problem is, I do not know how to check a save game slot for a variable to choose which Slot gets deleted.

Currently it will only delete a specified Slot. If I do a variable, I still have to define a number in it's value which won't work. If it doesn't get a number in the variable, it defaults to 1. I think I need a way to have save data checked for a variable, and return the slot number associated with that variable.

I think if I were to have it on startevent check game variable Hardcore, if true add game variable Hardcore1, if not add game variable Hardcore etc would solve my iteration problems, do 10 of those for safety so if all 10 save files heaven forbid are all Hardcore files they should all be Hardcore then Hardcore1-9. That way I can call each one individually as needed tying one player file to one save file by unique variable.

Now I need to know if I can search save files for these specific Variable Keys and return which slot they are in numerically as a variable I can use to call Delete Save Game with. Or how to get Delete Save Game to do that through the variable area.

If this is possible, please direct me on how to make this a reality on my side.

Thanks!
Mel
  • Should it only delete the last save file or all hardcore save files?
    An alternative would be using only auto save slots instead of letting the player freely select save files ...

    Generally, if you want to check information from a save file, you'll have to load/parse the data and get the variable from there. It's a big complex but doable, e.g.:
    DataObject data = ORK.SaveGame.LoadFile(index);
    This will get you the data of the save file number index.
    From there, you'd need to get to the correct data for the global variables.

    This should get you a variable handler with the global variables from the save file:
    DataObject data = ORK.SaveGame.LoadFile(index);
    DataObject gameData = data.GetFile("game");
    VariableHandler handler = new VariableHandler(false);
    handler.LoadGame(gameData.GetFile("variables"));


    The handler can be used for your variable checks.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you!

    The design would be like, On New Game, Choose Difficulty, Pick Hardcore and it searches global variables to see if Hardcore is in play, if it is, it then creates Hardcore1 variable and sets it active, if not then Hardcore. I was hoping that the variable would be saved to the individual game file in the save it creates for that character so I could use it to search only the file they saved to with this character. That way it only deletes that file and no other hardcore files.

    I do like the idea of using auto save feature for that, but it also could pose problems, like what happens if you are fighting a hard boss, and mid way though the long fight it auto saves on you? Now your retry is middle boss fight if you lose. lol

    For the above, I assume I would need to add this to the Access Handler?
  • Or would I need to open the death.asset script and manually add it in through like Visual Studio?
  • Well, auto save doesn't automatically save, it simply has a defined auto save file where any auto saving goes to - you still control when you auto save, e.g. through the event system or save points.
    So, the player still can decide when to save (e.g. via save point using the Auto Save type, or via an interaction with some dialogue, etc.), but doesn't select a save file, just keeps saving into the same auto save file - deleting it would pretty much remove all progress and requires to start from new game :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Perfect, that is the solution no doubt, locking them away from normal save files and into Autosave.

    Thanks, I was thinking it was saving on it's own at intervals, but this is exactly what I needed.

    Mel
Sign In or Register to comment.