SaveUtils.lua -- Itemized Data Storage Across Mods

One thought: There is a player email address stored with the savegame. Are there any functions for modifying this? As it is unused currently, it could be a temporary replacement for scriptdata, at least on the Player.

ScriptData didn't work on Cities (at least, GETscriptdata didn't) and I never checked plots; I'm pretty sure the Player is all anyone had used.
 
One thought: There is a player email address stored with the savegame. Are there any functions for modifying this? As it is unused currently, it could be a temporary replacement for scriptdata, at least on the Player.

ScriptData didn't work on Cities (at least, GETscriptdata didn't) and I never checked plots; I'm pretty sure the Player is all anyone had used.

If definitely worked for plots - I was using that before the data save cataclysm hit.
 
One thought: There is a player email address stored with the savegame. Are there any functions for modifying this? As it is unused currently, it could be a temporary replacement for scriptdata, at least on the Player.

ScriptData didn't work on Cities (at least, GETscriptdata didn't) and I never checked plots; I'm pretty sure the Player is all anyone had used.

I think cities were deprecated because they can be handled by plots. I'm pretty sure plot and unit worked just fine. I know GameInfo's script data didn't work tho.

As to hijacking the email for serialized data... :]

Lets not go there. Obviously the developers have something else in mind. It would be better if they worked with us instead of pulling the rug out from under us, but whatever. We'll just have to wait to get word I guess.
 
I haven't found my email in the savegame, or does it encode strings?

Game.GetName doesn't seem to work, it returns a NYI (not yet implemented?) error message

On a first tentative try, using PreGame.SetMapScript seems to work with the small caveat that it breaks the display of it when loading, but it should be safe enough because the map script isn't executed when you load.
 
I haven't found my email in the savegame, or does it encode strings?

Game.GetName doesn't seem to work, it returns a NYI (not yet implemented?) error message

On a first tentative try, using PreGame.SetMapScript seems to work with the small caveat that it breaks the display of it when loading, but it should be safe enough because the map script isn't executed when you load.

That works fine for me, honestly.
 
Whys, I tested adding your own content add-in points and it works fine :)

So it's possible to add ShareData as an InGameUIAddin, create a new content type called ShareDataAddin and load those contexts in ShareData when it's ready to receive share commands. This would get rid of having to share data on LoadScreenClose rather than simply writing it into the base script and you could actually induce an ordering in ShareData if you want to. I basically just copied the code from InGame.lua to create my own content point for custom missions (unit actions)

Just to be sure I understand, people could load their lua as a ShareDataAddin thereby ensuring it loads after ShareData which would be loaded as an InGameUIAddin?

Clever idea, unfortunately I don't think that will address the root of the problem, which is attempting to access share functionality from the global-scope of a modded built-in lua file, ie: TopPanel. Unless I'm missing something of what you said.
 
I've come back to modding after a month or so of not touching it, and for some reason:



include ("SaveUtils");
MY_MOD_NAME= "MyMod";

...

load(plot, timeKey);

"attempt to call global 'load' (a nil value)"

Have I forgotten something really obvious here? How could this be happening? :( Any suggestions?
 
edit: could try playing with the include path, if you've changed the directory structure. Maybe it's has gotten pickier.

Could be something like that. After the patch, I had to start fully qualifying the path in my InGameUIAddIn statements to get them to load properly since all my lua files are in a "lua" directory. include("SaveUtils") works fine for me but the file including it is in the same directory.
 
Top Bottom