Page 1 of 2

Script error using when loading save/launching rocket on old save game.

Posted: Sun Jan 31, 2021 2:02 pm
by Klonan
This can happen when you started the game a very long time ago, or started a game from the map editor after saving it as a scenario.

Unzip the save game, and open the folder:

explorer_2021-01-31_14-58-43.png
explorer_2021-01-31_14-58-43.png (4.67 KiB) Viewed 6771 times

Then delete everything except for the level.dat and script.dat.
NOTE: The level.dat might be split into numbered chunks, e.g level1.dat, level2.dat, level.datmetadata. Don't delete any of them.

explorer_2021-01-31_15-00-11.png
explorer_2021-01-31_15-00-11.png (8.76 KiB) Viewed 6771 times
explorer_2021-01-31_15-00-38.png
explorer_2021-01-31_15-00-38.png (1.31 KiB) Viewed 6771 times

Now copy these 2 files into the save game folder:

control.lua
(118 Bytes) Downloaded 214 times
freeplay.lua
(6.18 KiB) Downloaded 213 times

(These files can also be found in Factorio/Base/Scenarios/Freeplay, if you take them from there be sure to COPY not MOVE)

explorer_2021-01-31_15-01-26.png
explorer_2021-01-31_15-01-26.png (5.24 KiB) Viewed 6771 times

And it should load again.

If that doesn't work post your save game here I and will look at it.

Re: Script error using when loading save/launching rocket on old save game.

Posted: Sun Jan 31, 2021 6:10 pm
by roodammy44
This did not work for me, unfortunately. Here is my original save:
_autosave3.zip
(9.45 MiB) Downloaded 149 times

Re: Script error using when loading save/launching rocket on old save game.

Posted: Mon Feb 01, 2021 7:13 am
by jocrafter2012
Doesn't work for me either, it can't find the "level.dat", although i have level.dat0 to level.dat32

same level as viewtopic.php?f=7&t=95480

Re: Script error using when loading save/launching rocket on old save game.

Posted: Mon Feb 01, 2021 8:58 am
by boskid
level.datX (where X = "metadata" or numbers) is just a level.dat in disguise. Just keep all of those. This save format was introduced recently in 1.1.14 so it had to already load fine in 1.1.14+ and be saved in that new version, that most likely means you do not need any of those fixing steps as save file was already loading fine in one of those recent version.

Re: Script error using when loading save/launching rocket on old save game.

Posted: Mon Feb 01, 2021 11:15 am
by jocrafter2012
I keept them but it didnt work

The problem is, that I cant launch rockets anymore in that save, although i used to be. Is there maybe a command to "finish" the game?
EDIT:
Clarification, I deleted all files as instructed above, exept for all the level.dat files and the scripts, inserted the designated files and it returned the aforementioned error

Re: Script error using when loading save/launching rocket on old save game.

Posted: Mon Feb 01, 2021 6:48 pm
by Klonan
jocrafter2012 wrote:
Mon Feb 01, 2021 11:15 am
I keept them but it didnt work

The problem is, that I cant launch rockets anymore in that save, although i used to be. Is there maybe a command to "finish" the game?
EDIT:
Clarification, I deleted all files as instructed above, exept for all the level.dat files and the scripts, inserted the designated files and it returned the aforementioned error
Your specific case is a bug, which I have now fixed for the next release (1.1.20)

Re: Script error using when loading save/launching rocket on old save game.

Posted: Mon Feb 01, 2021 7:30 pm
by jocrafter2012
Thanks

Re: Script error using when loading save/launching rocket on old save game.

Posted: Mon Feb 01, 2021 8:42 pm
by roodammy44
Great work! That's some fast dev work!

Re: Script error using when loading save/launching rocket on old save game.

Posted: Sun Feb 07, 2021 6:27 pm
by Stroichik
Hello. I have same error with my save. Tried both fixes and they didn't work.

Can u possibly fix my save? 58 play hours...

Edit: I was able to somehow recover a save by using map editor and converting a save into a scenario. So i kinda saved factory.
And somehow today my saves just was able to load without errors. Dunno why. But somehow it all works now, i think there was a patch today too.

Re: Script error using when loading save/launching rocket on old save game.

Posted: Sat Feb 20, 2021 11:22 pm
by wievo
Did not work for me either. The new save does not even display that it is the incorrect version, loading itself is not possible.

Re: Script error using when loading save/launching rocket on old save game.

Posted: Sun Feb 21, 2021 9:08 am
by rubafix
hello

i have some questions

is it working without delete files level.dat and script.dat. ?
my files is diffentes is a probleme ?
Image

can i post a script to update all save files ?
is it possible to make a script to command factorio open/update/close save files ?

thx for your time

Re: Script error using when loading save/launching rocket on old save game.

Posted: Sun Feb 21, 2021 10:37 am
by Klonan
rubafix wrote:
Sun Feb 21, 2021 9:08 am
hello

i have some questions

is it working without delete files level.dat and script.dat. ?
my files is diffentes is a probleme ?
Image

can i post a script to update all save files ?
is it possible to make a script to command factorio open/update/close save files ?

thx for your time
What specific error do you have?

Re: Script error using when loading save/launching rocket on old save game.

Posted: Mon Feb 22, 2021 11:05 am
by rubafix
no specific error
script to update all save

Code: Select all

@echo off
cd /d %~dp0
set sevenzip=
set factorio=C:\Users\%USERNAME%\AppData\Roaming\Factorio\saves
set source=c:\Program Files (x86)\Steam\steamapps\common\Factorio\data\base\scenarios\freeplay

rem copy files to factorio saves folders
copy %source%\control.lua %factorio%
copy %source%\freeplay.lua %factorio%
cd /d %factorio%

rem 7z.exe path
if "%sevenzip%"=="" if exist "%ProgramFiles(x86)%\7-zip\7z.exe" set sevenzip=%ProgramFiles(x86)%\7-zip\7z.exe
if "%sevenzip%"=="" if exist "%ProgramFiles%\7-zip\7z.exe" set sevenzip=%ProgramFiles%\7-zip\7z.exe
if "%sevenzip%"=="" echo 7-zip not found&pause&exit

rem make folder zip name
FOR %%i IN (*.zip) DO mkdir "%%~ni"

rem copy lua in folders
for /r "%factorio%" %%i in (.) do @copy "control.lua" "%%i"
for /r "%factorio%" %%i in (.) do @copy "freeplay.lua" "%%i"

rem add folder to zip
FOR /r %%i IN (*.zip) DO "%sevenzip%" a "%%~ni.zip" "%%~ni\control.lua" > nul
FOR /r %%i IN (*.zip) DO "%sevenzip%" a "%%~ni.zip" "%%~ni\freeplay.lua" > nul

rem remove all temp folders
for /f "tokens=*" %%i in ('dir /b /s /a:d "%~1"') do rd /S /Q "%%~i"
del freeplay.lua
del control.lua
exit

Re: Script error using when loading save/launching rocket on old save game.

Posted: Mon Feb 22, 2021 1:24 pm
by Klonan
rubafix wrote:
Mon Feb 22, 2021 11:05 am
no specific error
If theres no error then you don't need to do anything

Re: Script error using when loading save/launching rocket on old save game.

Posted: Fri Dec 10, 2021 3:01 pm
by cool_balrog00
Hello! I've been struggling with this for a while now. My save has many level.dat files but no one file named "level.dat" without a number affixed to the end.
Capture.PNG
Capture.PNG (3.84 KiB) Viewed 4598 times
I just loaded the backup and it still runs (but will crash if I click on the rocket silo GUI at the top left or if I launch a rocket). After applying the fix I receive an error looking for "level.dat" (I triple-checked that I didn't delete it by mistake, and did not LOL) and it won't load or allow me to convert to a scenario.
screen.PNG
screen.PNG (9.46 KiB) Viewed 4598 times
I've attached a copy of my save after following the steps above. Would you mind taking a look? (I have many many hours on this one and would hate to lose it).

I have the backup I made as well if you need me to upload that. Any help would be much appreciated! Thank you!

Re: Script error using when loading save/launching rocket on old save game.

Posted: Fri Dec 10, 2021 4:13 pm
by Stringweasel
cool_balrog00 wrote:
Fri Dec 10, 2021 3:01 pm
Hello! I've been struggling with this for a while now. My save has many level.dat files but no one file named "level.dat" without a number affixed to the end.

Capture.PNG

I just loaded the backup and it still runs (but will crash if I click on the rocket silo GUI at the top left or if I launch a rocket). After applying the fix I receive an error looking for "level.dat" (I triple-checked that I didn't delete it by mistake, and did not LOL) and it won't load or allow me to convert to a scenario.

screen.PNG

I've attached a copy of my save after following the steps above. Would you mind taking a look? (I have many many hours on this one and would hate to lose it).

I have the backup I made as well if you need me to upload that. Any help would be much appreciated! Thank you!
A while ago the devs change how saving works. Newer versions of Factorio saves multiple `level.datX` files, instead of only one `level.dat`, so there's nothing missing :)

Are you running the newest version of Factorio? I've had it before complain about not finding `level.dat`, but that was because I was trying to load a newer save on an older version of Factorio.

Re: Script error using when loading save/launching rocket on old save game.

Posted: Fri Dec 10, 2021 4:48 pm
by cool_balrog00
Thanks for de-mystifying my many files LOL! I'm running the current version of Factorio. Just downloaded the latest version this morning.

Re: Script error using when loading save/launching rocket on old save game.

Posted: Fri Dec 10, 2021 8:37 pm
by Silari
cool_balrog00 wrote:
Fri Dec 10, 2021 4:48 pm
Thanks for de-mystifying my many files LOL! I'm running the current version of Factorio. Just downloaded the latest version this morning.
The one you uploaded has a second nested directory inside the zip - there should only be one. It's still missing files though when that's fixed. Upload your backup copy that still loads.

Re: Script error using when loading save/launching rocket on old save game.

Posted: Sat Dec 11, 2021 1:18 am
by cool_balrog00
Attached is the original save file that still runs. Thanks for looking!

Re: Script error using when loading save/launching rocket on old save game.

Posted: Sat Dec 11, 2021 8:39 am
by Silari
cool_balrog00 wrote:
Sat Dec 11, 2021 1:18 am
Attached is the original save file that still runs. Thanks for looking!
Nothing attached there. Make sure you give it time to upload and double check after posting.