Page 1 of 1

Can I force certain values for other mods' startup settings?

Posted: Mon Sep 05, 2022 8:09 pm
by bluegreen1024
I'm trying to make a mod that depends on other mods, and I want to make sure specific settings of those mods are enabled or disabled. This is largely because some mods will add prototypes or not depending on the value of a startup setting and my mod will depend on those prototypes existing. Is it possible, and if so how can I do it? (Apologies if this has been asked before, but searching for "setting" in the forums turns up a lot of spurious results).

Re: Can I force certain values for other mods' startup settings?

Posted: Mon Sep 05, 2022 8:29 pm
by Xorimuth
bluegreen1024 wrote:
Mon Sep 05, 2022 8:09 pm
I'm trying to make a mod that depends on other mods, and I want to make sure specific settings of those mods are enabled or disabled. This is largely because some mods will add prototypes or not depending on the value of a startup setting and my mod will depend on those prototypes existing. Is it possible, and if so how can I do it? (Apologies if this has been asked before, but searching for "setting" in the forums turns up a lot of spurious results).
Yes:
for bool-setting use forced_value (and hidden = true)
for other setting types use allowed_values

Re: Can I force certain values for other mods' startup settings?

Posted: Mon Sep 05, 2022 8:45 pm
by robot256
Xorimuth is right. Specifically, you would make those changes in your own mod's settings, settings-updates, or settings-final-fixes code. It shouldn't matter which if you already have a dependency on the other mod, unless another mod is changing the same settings too.

Re: Can I force certain values for other mods' startup settings?

Posted: Mon Sep 05, 2022 8:48 pm
by FuryoftheStars
You can access the other mod’s settings by referencing them through settings.startup["mod-setting-name"].