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).
Error while running deserialisation
-
- Burner Inserter
- Posts: 6
- Joined: Sat Aug 13, 2016 6:43 am
- Contact:
Error while running deserialisation
- Attachments
-
- control.lua
- (36.32 KiB) Downloaded 135 times
-
- _autosave1-backup.zip
- (31.42 MiB) Downloaded 97 times
Re: Error while running deserialisation
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
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
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.
If you avoid that it works well beyond that limit.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Error while running deserialisation
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.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Burner Inserter
- Posts: 6
- Joined: Sat Aug 13, 2016 6:43 am
- Contact:
Re: Error while running deserialisation
Awesome, thanks for the help guys!