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

This subforum contains all the issues which we already resolved.
IWTDU
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Apr 04, 2019 8:46 am
Contact:

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

Post 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.
Attachments
SandboxedLuaCombinator_0.3.4.zip
mod
(160.2 KiB) Downloaded 132 times
crash-test.zip
save
(1.23 MiB) Downloaded 116 times
factorio-current.log
(9.75 KiB) Downloaded 132 times

IWTDU
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Apr 04, 2019 8:46 am
Contact:

Re: [0.18.3] Crash when saving with my mod

Post 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).

Rseding91
Factorio Staff
Factorio Staff
Posts: 14180
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”