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

Anything that prevents you play the game properly. Do you have issues with paying for the game, downloading it or properly running it on your computer? Let us know here.
Post Reply
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 4764
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

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

Post 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 754 times

Then delete everything except for the level.dat and script.dat.

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

Now copy these 2 files into the save game folder:

control.lua
(118 Bytes) Downloaded 27 times
freeplay.lua
(6.18 KiB) Downloaded 26 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 754 times

And it should load again.

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

roodammy44
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Jan 31, 2021 12:29 pm
Contact:

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

Post by roodammy44 »

This did not work for me, unfortunately. Here is my original save:
_autosave3.zip
(9.45 MiB) Downloaded 7 times

jocrafter2012
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Mar 21, 2017 4:31 pm
Contact:

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

Post 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

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 1397
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

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

Post 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.

jocrafter2012
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Mar 21, 2017 4:31 pm
Contact:

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

Post 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

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 4764
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

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

Post 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)


roodammy44
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Jan 31, 2021 12:29 pm
Contact:

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

Post by roodammy44 »

Great work! That's some fast dev work!

Stroichik
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Feb 07, 2021 6:25 pm
Contact:

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

Post 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.
Attachments
_autosave3.zip
(27.23 MiB) Downloaded 3 times

wievo
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Feb 20, 2021 11:17 pm
Contact:

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

Post 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.
Attachments
_autosave3.zip
(23.9 MiB) Downloaded 2 times

User avatar
rubafix
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Nov 16, 2016 8:24 pm
Contact:

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

Post 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

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 4764
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

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

Post 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?

User avatar
rubafix
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Nov 16, 2016 8:24 pm
Contact:

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

Post 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

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 4764
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

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

Post 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

Post Reply

Return to “Technical Help”

Who is online

Users browsing this forum: No registered users