SaveUtils.lua -- Itemized Data Storage Across Mods

No worries, I'd taken it in the light hearted manner of the response anyway :)

I may have come undone, in that one apsect relies on a concatanation of player ID numbers to form unique keys, whereas the other just uses player IDs, so a quick look has me of the opinion that outside of saving both tables within a mother table(?) one of them will have to go :-S
 
There is an error in the code. The standard lua interpreter can live with it but LuaJIT does stumble on it: on line 511 to 514 of SaveUtils.lua, the "\[" escapes are wrong and must be replaced by "["
 
There is an error in the code. The standard lua interpreter can live with it but LuaJIT does stumble on it: on line 511 to 514 of SaveUtils.lua, the "\[" escapes are wrong and must be replaced by "["

Is that a mistake I've made, a result of using an old version (as included in Culture Diffusion v6), or just something with SaveUtils?
 
Is that a mistake I've made, a result of using an old version (as included in Culture Diffusion v6), or just something with SaveUtils?
The only thing I know is that this error does exist on the code within the spoiler markup on the first page. I initially discovered it by debugging a log for Reseed from a user who has CivUP and LuaJIT enabled, CivUP being the one that includes SaveUtils.

As for who did it and such, I am not familiar enough with this library or your own work. If you are unsure whether your version does have this error or not, just search for the "\[" character pair.
 
The only thing I know is that this error does exist on the code within the spoiler markup on the first page. I initially discovered it by debugging a log for Reseed from a user who has CivUP and LuaJIT enabled, CivUP being the one that includes SaveUtils.

As for who did it and such, I am not familiar enough with this library or your own work. If you are unsure whether your version does have this error or not, just search for the "\[" character pair.

Will do :)

I'd split things into seperate mods anyway, but it'll be something I'll bear in mind in future
 
Thank you for this work!

You didn't say to do this, but I've always been curious about what my stuff is used for in other games, so I thought I'd let you know that I used this to save the number of panels discovered for the Viking Sagas trait in my Denmark Exploration mod. You've been credited at the bottom of the page.

Again, thank you. SaveUtils is very impressive.
 
There is an error in the code. ...the escapes are wrong and must be replaced...

There must be NO ESCAPE! :lol:

I gave up on Civ5 a long time ago, so there's zero chance I'm going to make any improvements to the posted code. That said, I appreciate that SaveUtils continues to make a difference in the community.

Incidentally, I've noticed some modders have stripped the caching functionality from their SaveUtils implementation. If modders wish to get the most out of what SaveUtils has to offer, then the caching functionality and existing global functions should be left intact. To this end, modders should also implement ShareData to make the cache accessible to all lua states and concurrent mods.

In the simplest terms, the Save object makes it possible to itemize data storage, while the Cache object improves performance, and ShareData makes it all accessible to all lua states. The global functions streamline the interaction between the three and provide helpful error and warning messages. But I digress.
 
Top Bottom