edited August 2014 in ORK Support
So I've been testing my game and I tested the save game node. Now I have some saves when my load game menu comes up. That got me wondering if I could clear those out. I selected the option to save as xml, so I searched for that filetype in the project so I could delete them manually, but found none. I searched through the documentation to figure out how to do it by code, but I've come up empty.

But I'm getting off-track. Deleting the save is really not the main goal.

What I'm looking to do is pretty commonplace in mobile apps these days:
- If the user presses "New Game", a new game is created.
- Once the user reaches a milestone (ie finishes an event), the game autosaves.
- If the user presses "Continue", the game is loaded at the latest autosave.
- If the user presses "New Game", the autosave is overwritten with a new game.

Is this possible?

Dave
Post edited by drod7425 on
  • The save games are not stored in the project. The location of save games is depending on the used operating system.
    When using File save games, they'll be stored in Unity's persistent data path, which is e.g. on windows 7 in your user's directory (I think somewhere in App-Data) - the path also contains your company and game name (as they've been set up in Unity).
    Saving to PlayerPrefs will (in Windows) save to the registry.

    You can do autosaves using the Auto Save Game event step or by using Save Point components set to Autosave (e.g. with trigger enter to create check points). There's only one autosave slot, so as soon as you start a different new game, you'll override it. Also, you can set the regular save slots to 0, only allowing auto save and not displaying other save slots.
    The only thing missing is a Continue button in the main menu, I'll look into that :)
    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!
  • Ah, found them! Great!

    I think I found the setting (Menus>Save Game Menu>Save Game Settings>Save Slots), but the lowest number of slots allowed seems to be 1.

    I could probably make a continue button. Would the logic for such a button look like:

    ORKDataFile dataFile;
    DataObject dataObject;

    void Start(){
    dataObject = new DataObject();
    dataFile = dataObject.GetDataFile(Application.persistentDataPath+"savegameAUTO.save",false);
    }

    void GUI () {
    if(GUILayout.Button("Continue")){
    ORK.Game.LoadGame(dataFile.ToDataObject());
    }
    }

  • If you the lowest save slots is 1, you aren't using the latest version - try upgrading, that's been changed recently :)

    You don't need to do any path stuff yourself - you can just call the load function to load a game like that:

    ORK.SaveGame.Load(SaveGameHandler.AUTOSAVE_INDEX);
    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!
  • Awesome! That's a lot easier than what I was trying to do...and it works! lol :)

    Thanks,
    Dave
Sign In or Register to comment.