Version 2
http://forums.civfanatics.com/showthread.php?t=392958
To use this file, place the following line of code in your modded file's
global scope and set your mod name.
include( "SaveUtils" ); MY_MOD_NAME= "myMod";
This file allows for itemized data storage across mods and caching of deserialized data. Caching functionality can be set to one of three states per mod: 0 = no cache, 1 = serialize on save(), 2 = serialize on sync(). Default = 1.
Now, the load() function will return the entire save table when the third parameter is false, or return the specific mod table when the second parameter is nil.
Many thanks to killmeplease for the serialize(), deserialize() functions, and the idea of spanning mods.
http://forums.civfanatics.com/showthread.php?t=392958
To use this file, place the following line of code in your modded file's
global scope and set your mod name.
include( "SaveUtils" ); MY_MOD_NAME= "myMod";
This file allows for itemized data storage across mods and caching of deserialized data. Caching functionality can be set to one of three states per mod: 0 = no cache, 1 = serialize on save(), 2 = serialize on sync(). Default = 1.
Now, the load() function will return the entire save table when the third parameter is false, or return the specific mod table when the second parameter is nil.
Many thanks to killmeplease for the serialize(), deserialize() functions, and the idea of spanning mods.