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

Place to get help with not working mods / modding interface.
bluegreen1024
Inserter
Inserter
Posts: 29
Joined: Wed Aug 24, 2022 9:56 pm
Contact:

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

Post 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).
Xorimuth
Filter Inserter
Filter Inserter
Posts: 730
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

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

Post 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
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
robot256
Smart Inserter
Smart Inserter
Posts: 1231
Joined: Sun Mar 17, 2019 1:52 am
Contact:

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

Post 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.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2767
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

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

Post by FuryoftheStars »

You can access the other mod’s settings by referencing them through settings.startup["mod-setting-name"].
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Post Reply

Return to “Modding help”