I'm considering using an asset (Extreme AI) with ORK. For saving Extreme AI's current state, you need to copy files from its Application.persistentDataPath folder (Application.persistentDataPath + "/ExtremeAI/Resources/Tables") to some other folder of your choice, and then when loading, copy the files back into Application.persistentDataPath + "/ExtremeAI/Resources/Tables", overwriting what's there.

My idea for doing this with ORK would be to include the needed FileUtil.CopyFileOrDirectory calls within the custom save data functions DataObject SaveGame() and LoadGame(DataObject data). But I'd need to know what the current save slot or autoslave slot being used is from within those functions, so I can sync up the file copying - eg I'd copy to or from folders named AIautosave, AIsave1, AIsave2... etc, but I need to know which one to pick during the saving/loading. Is there a way to check the slot being used from within DataObject SaveGame() and LoadGame(DataObject data)? (Or is there a better way/place to do this?)
  • No, that's not possible ... however, you could just read the content of the files (e.g. as a string) and store them in the custom save data.
    That way they'd be saved and loaded with the ORK save game. In your custom save data class you'd handle reading and writing to the files.

    As the custom save data how-to explains, you'd just have to use the Set and Get functions of the DataObject to store and retreive the data.
    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!
Sign In or Register to comment.