I’m using these two methods for my save games (in Engine.uc). Works great for the most part.
/**
* Serializes an object to a file (object pointers to non-always loaded objects are not supported)
*
* @param Obj The object to serialize
* @param Pathname The path to the file to save
* @param bIsSaveGame If TRUE, FILEWRITE_SaveGame will be used to create the file writer
* @param Version A version number to save with the archive, so that we can safely fail when loading old versioned files
* @param bEncrypt - should file be encrypted? Loading it back will be automatic if encrypted.
*
* @Return TRUE if successful
*/
native static final function bool BasicSaveObject(Object Obj, string Pathname, bool bIsSaveGame, int Version, optional bool bEncrypt=false);
However the 4th param (“Version”) implies that files saved with version X, will safely fail when loading with verison Y.
I’m finding that whatever value I pass for “Version”, the file loads fine anyway. I’m making some breaking changes to my game, so want to utilize this version value to kill off save games for old builds.
Does anyone have any experience with this that can offer some advice?