Ammo Loader+


More than just a turret loader. Auto load everything from turrets to artillery wagons to furnaces and even the player themselves. Auto upgrade ammo and fuel without tedious manual replacement. Infinite range and compatible with Factorissimo2.

Content
16 days ago
0.14 - 1.1
21.2K
Logistics

g [0.18.28] error loading savegame

3 years ago

Hi silentcrim,

I got the following message if I try to load a savegame.

Error while running reload_script: The mod Ammo Loader+ (0.18.69) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event ammo-loader_18::on_save()
Cannot serialise lua function as a table key. Lua functions are deleted(nil) from keys and values after load

Hope that helps

Best regards

3 years ago

The savegame con be found here along with a message from the developers.

https://forums.factorio.com/viewtopic.php?f=11&t=85418

3 years ago

I think this was posted under wrong mod :)

3 years ago

Hi all, thanks for informing me of this. Just to clarify boskid, is my mod causing this issue or was it mistakenly attributed to my mod? I can't remember ever putting functions in the global table, but if I did I'll try and get it fixed as expediently as possible.

I do use functions as keys, but only in static tables defined as top-level lists. I did not realize this was an unacceptable practice in lua, as it has never caused problems for me before. Is this something I need to change as well?

3 years ago
(updated 3 years ago)

This issue is easily reproduciple with "ammo-loader_18" mod (not this mod) by simply doing new map and then saving while in this mod everything seems fine - this is why i am calling it was posted under wrong mod.

In the other mod (with _18 suffix), in Factorio 0.18.27 or previous (when script data were serialised using serpent.dump) there was something like this in the script saved state (output of serpent.dump):

_.ItemDB.items["firearm-magazine"].effectsSummary.types[type]=0x5p+0;
_.ItemDB.items["piercing-rounds-magazine"].effectsSummary.types[type]=0x8p+0;

and here the "type" function is used as a key while the variable was being serialised. Using functions as key is now forbidden when such table can be reached from the global because it cannot be serialised anymore.

3 years ago

I see! Thanks for clarifying. I've been trying to contact that mod's owner to get them to deprecate it, but hopefully another attempt will yield results.

Thanks for all you and the development team do btw! This is one of the best online communities I've ever had the pleasure of participating in.

New response