I only get this error, when I haveError while running deserialisation: [string "do local _={overlays={},freeze={}};local tabl..."]:1: too many local variables (limit is 200) in main function near '='
Error while running deserialisation
Error while running deserialisation
I am writing a mod (Bottleneck), which puts indicator lights on assembling machines and furnaces. The mod keeps track of these with a table "overlays" that maps machine to its indicator light. So far so good. The problem comes, if I place this table in global (i.e., replace "overlays" with "global.overlays"). Then I get this error on load time:
more than 200 a bunch of assembling machines in the table. What is the correct way to do this?
- DedlySpyder
- Filter Inserter
- Posts: 254
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: Error while running deserialisation
Can you provide the actual code that causing the problem? The error cuts it off.
Re: Error while running deserialisation
The error occurs in the deserialisation, and thus not directly in code that I have written. The code for the mod can be found here: https://raw.githubusercontent.com/troel ... ontrol.lua.DedlySpyder wrote:Can you provide the actual code that causing the problem? The error cuts it off.
Re: Error while running deserialisation
Zinal posted a fix. It appears that serialisation doesn't work properly, if the table contains entities as indices or values.
https://github.com/troelsbjerre/Bottleneck/issues/1
https://github.com/troelsbjerre/Bottleneck/issues/1
Re: Error while running deserialisation
Yes it does, you're just hitting a built in limit of Lua. See my reply on the github conversation.trold wrote:Zinal posted a fix. It appears that serialisation doesn't work properly, if the table contains entities as indices or values.
https://github.com/troelsbjerre/Bottleneck/issues/1
If you want to get ahold of me I'm almost always on Discord.
Re: Error while running deserialisation
Could I get you to check out the "naiveglobal" branch of troelsbjerre/Bottleneck, and have a look at why that give an error after saving and loading? As far as I can see, I only have two values directly in the global table.Rseding91 wrote:Yes it does, you're just hitting a built in limit of Lua. See my reply on the github conversation.
Re: Error while running deserialisation
Can you upload a save file that has this issue in it?trold wrote:Could I get you to check out the "naiveglobal" branch of troelsbjerre/Bottleneck, and have a look at why that give an error after saving and loading? As far as I can see, I only have two values directly in the global table.Rseding91 wrote:Yes it does, you're just hitting a built in limit of Lua. See my reply on the github conversation.
If you want to get ahold of me I'm almost always on Discord.
Re: Error while running deserialisation
Sent in a PM.Can you upload a save file that has this issue in it?
Re: Error while running deserialisation
So what was the conclusion of that thread ? Any solution to avoid the serialisation problem on long lists ?
Is avoiding table indexed with entities is the final solution ?
No limitations on tables indexed by numbers of strings ?
Is avoiding table indexed with entities is the final solution ?
No limitations on tables indexed by numbers of strings ?
My mods on the Factorio Mod Portal 

Re: Error while running deserialisation
It's a limitation of the lua library - not something we can change.binbinhfr wrote:So what was the conclusion of that thread ? Any solution to avoid the serialisation problem on long lists ?
Is avoiding table indexed with entities is the final solution ?
No limitations on tables indexed by numbers of strings ?
If you want to get ahold of me I'm almost always on Discord.
Re: Error while running deserialisation
Ok, thx Rseding, I just wanted a clarification on what should be avoided.Rseding91 wrote:It's a limitation of the lua library - not something we can change.
If you have in minds other coding situations that could lead to such errors, please share

My mods on the Factorio Mod Portal 
