Spatzimaus
Mad Scientist
I had a big response ready for this yesterday, but then my browser crashed. So here goes again.
That's the problem. I need a persistent updating ability, NOT something that is only tied to save/load periods; even if we DID have a save event, I really need something more reliable when making small changes between those events. Some of my variables are set at the start of the game and never touched again (your choice of pantheon or primary god), some are updated every once in a while (adding a minor god, changing alignment through an Event), and some occur every turn (or even several times per turn, like Favor increases). With that sort of variation, it just wouldn't be smart to use something that requires me to save the entire data structure every time I want to make a small change to a single entry. The ScriptData functions, which is what the save utilities I'm using now leverage, are more flexible on that.
Now, all data access is linked through a series of utility access functions inside MythUtils.lua, so if I do end up changing my storage mechanism, it'd be transparent to my higher-level functions. So I could put some of my variables into one save mechanism and keep the old system for others if need be. The thing is, the save utilities I have DO work in other mods; it's just that for some reason, in my mod it's not indexing the Player structure correctly when saving values on later turns, and I'm not sure why. The fix is probably something fairly simple, so I'm still trying to see if the old logic can be saved before throwing it all out to use a new system. But if I can't get it to work, then I'll look into switching some of it to your system instead.
The savegame intercept is just a little klunky in its interface (we really need a GameSave event) but it works fine.
That's the problem. I need a persistent updating ability, NOT something that is only tied to save/load periods; even if we DID have a save event, I really need something more reliable when making small changes between those events. Some of my variables are set at the start of the game and never touched again (your choice of pantheon or primary god), some are updated every once in a while (adding a minor god, changing alignment through an Event), and some occur every turn (or even several times per turn, like Favor increases). With that sort of variation, it just wouldn't be smart to use something that requires me to save the entire data structure every time I want to make a small change to a single entry. The ScriptData functions, which is what the save utilities I'm using now leverage, are more flexible on that.
Now, all data access is linked through a series of utility access functions inside MythUtils.lua, so if I do end up changing my storage mechanism, it'd be transparent to my higher-level functions. So I could put some of my variables into one save mechanism and keep the old system for others if need be. The thing is, the save utilities I have DO work in other mods; it's just that for some reason, in my mod it's not indexing the Player structure correctly when saving values on later turns, and I'm not sure why. The fix is probably something fairly simple, so I'm still trying to see if the old logic can be saved before throwing it all out to use a new system. But if I can't get it to work, then I'll look into switching some of it to your system instead.