Cross-mod lua conflicts with SaveUtils?

ZUKA

Chieftain
Joined
Mar 5, 2016
Messages
4
I've been searching for examples of this or how to solve it but come up dry, so here we go.

In my case I have a mod which is conflicting with mine. However, the behavior is weird. Basically, if the other mod is loaded, SaveUtils.lua magically forgets a few of its functions.

Now, SaveUtils is pretty old now so I figured it might just be easier to update to a newer implementation. The mod that was conflicting uses Sukritact_SaveUtils.lua so I did a quick port to that and disabled some of the manual cache management just to get a build up.

And now THEIR mod breaks, citing some suddenly now invalid data being passed into SetValue().

So what the heck? What can I do to help ensure both mods are properly sandboxed here? Other mods appear to use SaveUtils without incident, so why is only mine causing explosions?
 
Yeah, something about Sukritact's SaveUtils doesn't mesh nicely with itself. I had this myself. I recommend using either NewSaveUtils or TableSaverLoader instead. TSL is more stable and reliant, in my experience, however, it's a bit of a steeper learning curve (but then I'm not a programmer, so I can't think about it in terms of what it does but only in terms of what I'm told it does :p).
 
Thanks, that seems to have solved the issue. I hacked up some quick interface functions and am back in business, but I'll need to do some refactoring for perf reasons now.

Do you know why these files conflicted in the first place? Or why their mod's SaveUtils broke Whys version? I'm hoping to understand the method of failure here as it's probably something I should be more aware of as I write more lua
 
Thanks, that seems to have solved the issue. I hacked up some quick interface functions and am back in business, but I'll need to do some refactoring for perf reasons now.

Do you know why these files conflicted in the first place? Or why their mod's SaveUtils broke Whys version? I'm hoping to understand the method of failure here as it's probably something I should be more aware of as I write more lua
It is most likely because of the goofy way the "include" command works as implimented by Firaxis. See DarkScythe's summary of how 'include' works in lua. There may be some extra discussion on the issue in that thread. This is essentially the problem that DarkScythe1 fixed for the TableSaverLoader system with his addon-system.


1
Spoiler :
let us all open our hymnals to page 47 of Songs For Retired Mod-Makers and sing "Oh Holo! Wherefor Art Thou?"

for that matter, we might also engage in a rousing chorus of "Pazyryk, Wherefor Hast Thou Abandoned Us?"
 
Wow.

Well at least that explains the original conflict. That's horrifyingly bad code though. Firaxis why :(
 
Back
Top Bottom