Page 1 of 1

[0.10.3] local variable limit killed my save game

Posted: Fri Jul 25, 2014 6:50 am
by Neotix
I have Wagons mod installed, and that mod store information in local variables.
After setting over 200 wagons I can't load a game because of that error:
Image

Deleting mod only cause game crash.

Link to mod section where I reported bug and get answer from mod creator
https://forums.factorio.com/forum/vie ... 107#p38107

Save: https://dl.dropboxusercontent.com/u/167 ... Gra001.zip

Game worked fine with that amount of wagons. Only savegame can't be load.

Re: [0.10.3] local variable limit killed my save game

Posted: Fri Jul 25, 2014 9:30 am
by Dark
Limit was reached by the script that was generated by engine and embedded into save file, engine reacts weirdly to a lot of

Code: Select all

glob.entities[#glob.entities+1] = entity
But everything is fine when nesting entities in a table

Code: Select all

glob.entities[#glob.entities+1] = {entity = entity}
Crash with mod removed could be caused by entirely unrelated bug.

Re: [0.10.3] local variable limit killed my save game

Posted: Fri Jul 25, 2014 11:20 am
by slpwnd
We are using serpent library (https://github.com/pkulchenko/serpent) for serialization. This seems to be related to how that one works. Actually script.dat files are readable files that contain lua code interpreted when the game is loaded.

Re: [0.10.3] local variable limit killed my save game

Posted: Fri Jul 25, 2014 11:40 am
by Neotix
Is there any way to fix that save? I would like to not lose over 200h of gameplay.

Re: [0.10.3] local variable limit killed my save game

Posted: Fri Jul 25, 2014 11:48 am
by SuperSandro2000
Have you no autosaves from before that point?

Re: [0.10.3] local variable limit killed my save game

Posted: Fri Jul 25, 2014 11:57 am
by slpwnd
Neotix wrote:Is there any way to fix that save? I would like to not lose over 200h of gameplay.
Have you simply tried deleting (or better renaming) the script.dat file? Actually I tried to load your save without any mods and it crashes and breaches couple of internal asserts (that are not present in the release build). There will be some work from our side needed to fix this.

Re: [0.10.3] local variable limit killed my save game

Posted: Fri Jul 25, 2014 12:07 pm
by Neotix
Whaaaa IT"S WORKING. Now I'm crying from happiness like a baby.
Deleting script.dat helps.

Re: [0.10.3] local variable limit killed my save game

Posted: Fri Jul 25, 2014 12:14 pm
by Dark
Neotix wrote:Whaaaa IT"S WORKING. Now I'm crying from happiness like a baby.
Deleting script.dat helps.
Be aware that you'll probably need to rebuild/replace manually a lot of modded buildings since script.dat contained information accumulated and needed by mods to work correctly.

Re: [0.10.3] local variable limit killed my save game

Posted: Fri Jul 25, 2014 12:38 pm
by Neotix
So far I noticed only that I lost items in Compressed chests (few thousands of resource) but it's not a big problem.

Re: [0.10.3] local variable limit killed my save game

Posted: Fri Jul 25, 2014 3:06 pm
by Rseding91
Neotix wrote:So far I noticed only that I lost items in Compressed chests (few thousands of resource) but it's not a big problem.
I'll be making a spawn-able tool that lets you set the amount a chest has stored for events like this.

EDIT: also, you didn't lose "a few thousands" :P you lost exactly 1,770,333 iron ore, 191,083 coal, and 771,687 stone.

Re: [0.10.3] local variable limit killed my save game

Posted: Fri Jul 25, 2014 11:45 pm
by JamesOFarrell
Neotix wrote:Whaaaa IT"S WORKING. Now I'm crying from happiness like a baby.
Deleting script.dat helps.
Glad this is working. Felt so bad not being able to help. I'm stuck on 3g at the moment so my internet access is very limited.