Page 1 of 1

[0.18.3] Crash to desktop when saving with mod: LuaCustomTable cannot be serialized.

Posted: Fri Jan 31, 2020 9:07 am
by IWTDU
mod page https://mods.factorio.com/mod/SandboxedLuaCombinator
It adds combinators programmable in lua.
I am developing mod, and at some point it become impossible to save game when any of my mod's combinators are active, while I can't find that I placing anything wrong to global table. Moreover, game crashes when I try it second time.
Reproducing:
- Load attached save file, with attached mod. It is just a new game with modded combinator placed with editor, with this mod only.
- Open combinator, type any text, press OK button.
- Try to save game - get error.
- Return to game. (important)
- Try to save game again. Now game crashes.

Re: [0.18.3] Crash when saving with my mod

Posted: Fri Jan 31, 2020 12:05 pm
by IWTDU
I found a workaround: don't store anything not serializable not just in global but anywhere it can be accessed by metatables (from objects in global).

Re: [0.18.3] Crash to desktop when saving with mod: LuaCustomTable cannot be serialized.

Posted: Fri Jan 31, 2020 6:50 pm
by Rseding91
Thanks for the report. The game crash is now fixed for the next release. The error is expected; LuaCustomTables aren't meant to be stored beyond a local functions execution since the game doesn't know how to save them and so they can never be saved.