Page 1 of 1

__level__/freeplay.lua:197: attempt to index global 'global' (a nil value)

Posted: Mon Oct 28, 2024 3:01 am
by kpgg
When attempting to load a years-long save file without mods after the space age update, I encountered this error when loading and fixing

Code: Select all

The scenario level caused a non-recoverable error.
Please report this error to the scenario author.

Error while running event level::on_configuration_changed
__level__/freeplay.lua:197: attempt to index global 'global' (a nil value)
stack traceback:
    __level__/freeplay.lua:197: in function 'on_configuration_changed'
    __core__/lualib/event_handler.lua:87: in function <__core__/lualib/event_handler.lua:84>
How do I fix it?

Re: __level__/freeplay.lua:197: attempt to index global 'global' (a nil value)

Posted: Mon Oct 28, 2024 3:08 am
by kpgg
If you have steam cloud enabled, disable it first.
Then, navigate to your save file location
  • On windows, it's "%appdata%\factorio\saves"
  • On linux, it's (probably) "~/.factorio/saves"
Then, find your world save, it's name should be "<name-of-your-world>.zip".
Unzip it with a new folder name and find the "freeplay.lua" file.
Find and replace all occurences of "global" with "storage" with a text editor.

Then, navigate to your freeplay scenario folder
  • On windows, it's "%appdata%\factorio\scenarios\freeplay"
  • On linux, it's (probably) "~/.factorio/scenarios/freeplay"
Find the "freeplay.lua" file.
Find and replace all occurences of "global" with "storage" with a text editor.

This should fix the problem.

Re: __level__/freeplay.lua:197: attempt to index global 'global' (a nil value)

Posted: Thu Oct 31, 2024 11:55 am
by Gummiente27
For me, the scenario folder can only be found inside the game install dir, not in the appdata folder, and its freeplay.lua has no "global" inside