[0.17.4] Scenario locale is not available to error until after scenario control.lua runs

Things that we don't consider worth fixing at this moment.
project6
Inserter
Inserter
Posts: 22
Joined: Sat Aug 15, 2015 10:31 pm
Contact:

[0.17.4] Scenario locale is not available to error until after scenario control.lua runs

Post by project6 »

A continuation of viewtopic.php?f=11&t=60767&p=366009

It seems that this was half-resolved: the locale data seems loaded, just unavailable to error while it is available to log.

3 control.luas for 3 test runs:

1) log in control init

Code: Select all

log({'apocalypse.apocalypse_already_running'})
As expected:

Code: Select all

  27.596 Info Scenario.cpp:147: Map version 0.17.4-1
  27.626 Script @C:/Users/Matthew/AppData/Roaming/Factorio/temp/currently-playing/control.lua:2: The apocalypse has already begun. There is nothing more to do in this world.
2) error in control init

Code: Select all

error({'apocalypse.apocalypse_already_running'})
Does not give the contents of locale:

Code: Select all

 226.463 Loading Level.dat: 1272918 bytes.
 226.464 Info Scenario.cpp:147: Map version 0.17.4-1
 226.635 Error AppManager.cpp:597: Unknown key: "apocalypse.apocalypse_already_running"
stack traceback:
	[C]: in function 'error'
	...Data/Roaming/Factorio/temp/currently-playing/control.lua:2: in main chunk
3) error in init

Code: Select all

script.on_init(
    function()
        error({'apocalypse.apocalypse_already_running'})
    end
)
As expected, the log shows the error correctly:

Code: Select all

Error while running event level::on_init()
The apocalypse has already begun. There is nothing more to do in this world.
stack traceback:
	[C]: in function 'error'
	...Data/Roaming/Factorio/temp/currently-playing/control.lua:3: in function <...Data/Roaming/Factorio/temp/currently-playing/control.lua:2>
Attachments
factorio-current.log
(5.24 KiB) Downloaded 67 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14601
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.4] Scenario locale is not available to error until after scenario control.lua runs

Post by Rseding91 »

Thanks for the report however this isn't going to be fixed.

The locale isn't valid for errors when the game has crashed since the locale is stored in the game and the game is gone at the point the crash happens.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Won't fix.”