Scenario "required mods" and sync-mods-with-scenario functionality

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 451
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Scenario "required mods" and sync-mods-with-scenario functionality

Post by raiguard »

EDIT: This really should be in modding interface requests. Could a mod please move it there? I'm sorry!

I would like to be able to specify a list of required mods for a specific scenario. For example, my Editor Extensions mod includes a "testing" scenario, and I would like to specify that players should have EE and flib enabled for the scenario to work. The reason being, the scenario relies on both of these mods existing, and if the user removes flib specifically, the scenario will simply crash on a bad require.

Perhaps there should be a way to bypass this list and load anyway (just in case), but it should at least warn the users of what they're doing.

Of course, it would be ideal if there was a "sync mods with scenario" button on the choose scenario screen as well.

Thank you!
Don't forget, you're here forever.

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Scenario "required mods" and sync-mods-with-scenario functionality

Post by Koub »

Raiguard wrote:
Mon Sep 14, 2020 9:40 pm
This really should be in modding interface requests. Could a mod please move it there?
[Koub] Indeed. Moved to Modding interface requests
Koub - Please consider English is not my native language.

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

Re: Scenario "required mods" and sync-mods-with-scenario functionality

Post by Rseding91 »

If the scenario *requires* the mod; why not just put the code in the mod and skip the scenario?
If you want to get ahold of me I'm almost always on Discord.

User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 451
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: Scenario "required mods" and sync-mods-with-scenario functionality

Post by raiguard »

In the case of flib, it's a library mod, so that just doesn't make sense.

For EE I can see your argument for this basic scenario, but for more complex scenarios, they might be expecting various mods to be present to provide the experience they intend. I can imagine that there are a lot of usecases for something like this, even if I personally can't come up with many.
Don't forget, you're here forever.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Scenario "required mods" and sync-mods-with-scenario functionality

Post by eradicator »

Rseding91 wrote:
Tue Sep 15, 2020 7:30 pm
If the scenario *requires* the mod; why not just put the code in the mod and skip the scenario?
That approach doesn't work for "scenario pack" type mods where not all included scenarios have the same requirements. Especially when the library author and the scenario author are not the same person.

Also as far as i know scenarios are copied to the user directory after being played once (MP server), so disabling the mod that originally contained the scenario doesn't remove the scenario from the menu.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Scenario "required mods" and sync-mods-with-scenario functionality

Post by Bilka »

+1 to this. My usecase is a debugging scenario in https://mods.factorio.com/mod/AbandonedRuins that spawns every single ruin. Obviously this is not part of normal gameplay and obviously it requires the mod to be present. Putting the code directly in the mod is not an option because that makes it impossible to start the game into the debug setup with a command line parameter.
Now, the problem is that if the player starts a multiplayer game with the scenario (without saving anything), the scenario will then show up in the "User scenarios" and can be started with the mod disabled. This fails because the scenario requires files from the mod it is from.

For now, I set the scenario to be multiplayer incompatible, but that is a workaround, not a solution. In my opinion it is nonsensical that mods can contain scenarios that rely on mod content, yet the game allows them to be started without the mod that originally contained them and without any indication that the scenario was part of a mod.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Scenario "required mods" and sync-mods-with-scenario functionality

Post by eradicator »

Bilka wrote:
Fri Sep 18, 2020 2:08 pm
Now, the problem is that if the player starts a multiplayer game with the scenario (without saving anything), the scenario will then show up in the "User scenarios" and can be started with the mod disabled.
This whole concept of "copy scenario to user scenarios" should probably be revied too (in a different topic). As far as i remember it can also lead to outdated versions of a scenario being selectable *despite* the containing mod being installed with a newer version.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 451
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: Scenario "required mods" and sync-mods-with-scenario functionality

Post by raiguard »

After a conversation on the #mod-making channel of the Factorio Discord, this is now more important than ever. Some scenarios that previously worked with vanilla will now require a mod to re-add some removed entities, but there is no way for scenarios to specify that certain mods are required in order for them to work properly.

Additionally, it was brought up that maybe it would be better if scenarios were tied more closely with mods, so you had to create a mod in order to create a scenario. But that is another topic for another thread.
Don't forget, you're here forever.

Post Reply

Return to “Modding interface requests”