Can I force certain values for other mods' startup settings?
-
- Burner Inserter
- Posts: 16
- Joined: Wed Aug 24, 2022 9:56 pm
- Contact:
Can I force certain values for other mods' startup settings?
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?
Yes:bluegreen1024 wrote: ↑Mon Sep 05, 2022 8:09 pmI'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).
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
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: Can I force certain values for other mods' startup settings?
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, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
-
- Smart Inserter
- Posts: 2768
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Can I force certain values for other mods' startup settings?
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