[0.16.45] Scenarios in mods can fail to find lua files

This subforum contains all the issues which we already resolved.
Post Reply
chrisgbk
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Mon Jan 02, 2017 4:31 am
Contact:

[0.16.45] Scenarios in mods can fail to find lua files

Post by chrisgbk »

If a mod contains multiple scenarios, the name of the scenario folder can impact the game being able to load files properly.

Consider the case where a mod contains two scenarios, named "Scenario" and "Scenario-2"

Loading "Scenario-2" will succeed, and loading "Scenario" will silently fail, only when loading directly from the mod, if the folder name of the scenarios matches anything up to whitespace or dashes. So "Scenario 2" will also cause "Scenario" to fail to load.

If the scenarios are extracted to the /scenarios/ directory and loaded there, they work fine.

If the second scenario is named "Scenario_2" it will also work.

Attached is an example mod which contains two scenarios as described. The control.lua in each scenario contains only a call to error(...); the first scenario will load instead with no control.lua at all.

Expected behaviour if the folders were improperly named would be for Factorio to refuse to load the mod.
Expected behaviour if the folder names are fine would be for Factorio to load the files for both cases.
Nothing shows up in Factorio-current.log when this occurs.
Attachments
example-scenario_1.0.0.zip
(1.83 KiB) Downloaded 143 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13373
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.45] Scenarios in mods can fail to find lua files

Post by Rseding91 »

Thanks for the report. It should be fixed for the next version of 0.16.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”