Page 1 of 1

Error while running deserialisation

Posted: Fri Nov 10, 2017 4:14 pm
by Ferovejecs
Wondering if this limit is intended, and whether there is a way around it?

Error while running deserialisation: [string "...":1: too many local variables (limit is 200) in main function near '='

Basically it seems that for lua code for a scenario, if there are more than 200 items in a hashmap, it crashes.

Script attached, also attached a save game which triggers this error upon loading it. I'll ask my friend to put up a desync log/report from attempting to join a game after this state (e.g. there having been more than 200 chests stored in the global hashmap).

Re: Error while running deserialisation

Posted: Fri Nov 10, 2017 4:37 pm
by Danner
Previously announced friend here.

Factorio deleted the original desync report zip file once I restarted the game, but I did have an uncompressed version of it lying around.
Here it is, recompressed. Warning: 100 mb download.

http://www.pvv.org/~andreasd/desync_report.zip

Re: Error while running deserialisation

Posted: Fri Nov 10, 2017 10:27 pm
by Rseding91
It's a limit of the Lua language. You're using tables as keys which is what triggers it.

If you avoid that it works well beyond that limit.

Re: Error while running deserialisation

Posted: Fri Nov 10, 2017 10:38 pm
by eradicator
Use unit_number instead of the position for your chests. The unit number is a unique identifier which is supposed to be used for indexing tables of entities.

Re: Error while running deserialisation

Posted: Fri Nov 10, 2017 10:52 pm
by Ferovejecs
Awesome, thanks for the help guys!