For example, in the oberhaul mod, the expectation is that the setting under "Bob's Assembling machines mod" for "Electrolysers" will be disabled. Is it possible to do this from the API?
If not, what would be a workaround to prevent issues from happening due to incorrect settings? For example, if "Electrolysers" is left enabled, then Steel processing cannot be researched due to missing the "Electrolysis 1" tech-dependency.
[Resolved]Possible to change another mod's settings?
[Resolved]Possible to change another mod's settings?
Last edited by jgb on Sun Aug 18, 2019 1:36 pm, edited 1 time in total.
Re: Possible to change another mod's settings?
yes use settings-updates.lua and settings-final-fixes.lua
https://lua-api.factorio.com/latest/Data-Lifecycle.html
also you can set the value of settings in a control.lua
https://lua-api.factorio.com/latest/Data-Lifecycle.html
also you can set the value of settings in a control.lua
Re: Possible to change another mod's settings?
Thanks.
Could you point me to an example of a mod that actually does this? I've checked a few now, and don't see any examples of this actually being implemented.
I saw Warptorio 2 had these files, but they are blank.
Could you point me to an example of a mod that actually does this? I've checked a few now, and don't see any examples of this actually being implemented.
I saw Warptorio 2 had these files, but they are blank.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Possible to change another mod's settings?
You can not "change" the settings *value* of another mods settings. What you can do is change the acceptable value range. But as you seem to be dealing with a boolean setting (checkbox?) you're out of luck as those do not have a value range. You could fool yourself into thinking that changing the default_value is sufficient, but that will be ignored if the user ever changes the setting manually.
Your only options are:
A) A modding interface request to support "allowed_values" on bool_setting.
B) Ask bob to detect the presence of your mod on his side. (You lose control over the behavior.)
C) Write your code in a way that doesn't depend on things you don't control...
Your only options are:
A) A modding interface request to support "allowed_values" on bool_setting.
B) Ask bob to detect the presence of your mod on his side. (You lose control over the behavior.)
C) Write your code in a way that doesn't depend on things you don't control...
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Possible to change another mod's settings?
Relying on other mod settings to have a certain value is bound to break at some point.
I'd go with eradicators option C, write your mod so it works regardless of other mods. In your case check if the tech exists otherwise either create it yourself or better use a different tech dependency or none.
I'd go with eradicators option C, write your mod so it works regardless of other mods. In your case check if the tech exists otherwise either create it yourself or better use a different tech dependency or none.
My Mods: mods.factorio.com
Re: Possible to change another mod's settings?
Okay, thanks for the replies. Based on all the implementations I've seen of various mods, it looks like that's how most people do it anyway. Or they release a modpack like Seablock.
-
- Filter Inserter
- Posts: 587
- Joined: Sun Jun 09, 2019 10:40 pm
- Contact:
Re: Possible to change another mod's settings?
The best way to do this is to talk to the developer of the other mod. Cooperation is far and away the best strategy. Most people are very happy to work with you rather than against you in making things work.