Enable all Feature Flags


A simple mod to enable all DLC feature flags in Factorio 2.0. This mod only works if you own the DLC!

Utilities
4 days ago
2.0
1.50K
Factorio: Space Age Icon Space Age Mod

g Question of understanding

4 days ago

I don't understand this.
if space-age is activated, all fllags are already set
otherwise the flags whose mods are activated are set.
why should the mod have to activate anything else?
do I miss something?

4 days ago

You may have the space age DLC without having the space age mod turned on.
For example this mod enables elevated rails in pyanodon, even though py is incompatible with space age.

4 days ago
(updated 4 days ago)

Ok, but if I activate the elevated-rails. then the elevated-rails feature is already activated. or am I wrong?
I must be on the wrong track ;-)

EDIT LOL that won't leave me in peace until I understand it
I have just installed it.
The features are activated, but the mods are not.
If a mod now asks for a feature, it becomes true, without the mod ist active, right?
but the resources can nevertheless be accessed, right? that would be the advantage.
hot or cold? ;-)

13 hours ago
(updated 13 hours ago)

@Kux
TL;DR This lets pyanodons load for players who -do not own the dlc- and -are restricted from using certain features like freezing/spoil/elevated/etc-, but if they -do own the dlc- then it enables those optional integrations (in py's case, spoil/elevated/stacking/etc) without making a separate spaceage extension mod. This mod just serves to see "does the player own the dlc" and enable/disable features based on that, because of the limitation of declaring used feature-flags in info.json restricting players who don't own the dlc from loading the mod entirely; as well as no convenient way to check "does player own dlc" at runtime plus the additional feature of having a way to play with "pretend I don't own dlc".

----- Wall of text ------
You can specify in info.json that a mod needs "space_travel_required": true or other feature flags. *footnote at the end
A mod with any feature flags set (including this one) cannot be loaded if DLC is -unowned-. It complains "user does not own feature x", because the info.json has one or more feature flags set to true.

You could set that feature flag inside your main mods info.json, but then people who don't own the DLC will not be able to load it period.
-This- mod allows one to, within their own -main- mods code, enable/disable features depending on whether -this- optional mod is loaded (like usual with any "optional" mod).
So you could add support for space age content/features in your main mod without making a separate mod and still allowing your main mod to be loaded by non-DLC-owning players.

This mod has nothing to do with a global "activation of flags to tell the game engine to load certain features".
It's about "making optional content available based on whether a player owns the DLC" (or more accurately, restricting DLC-requiring content for players that don't own it while still allowing the main mod to load by not setting flags that would prevent them playing on the main mod).

Footnote:
Currently there are 6 of them, even though realistically from what I can tell they act as an OR gate, since any of them being enabled demands you own the only DLC... this may become relevant if future dlc are released but as far as I can tell it's not necessary to include all the ones you want to use? I'm not sure if it -selectively- enables certain lua functions that are considered DLC-only (in which case it makes sense for them all/as needed) but trying to use them without declaring at least one random flag throws errors. These feature flags and their underlying executable/hardcoded code are not dependent on SpaceAge mod afaik, so you can make a freezing-using mod players can use without the SpaceAge mod active.

13 hours ago
(updated 13 hours ago)

Edit: -got doubleposted-

13 hours ago

thank you very much for the super detailed explanation

13 hours ago
(updated 13 hours ago)

One other note, as exampled here and I hadn't really considered but is a perfect reason why they exist individually: https://lua-api.factorio.com/latest/types/FeatureFlags.html

-- sets coal to spoil only when the spoiling feature flag is enabled
if feature_flags["spoiling"] then
data.raw.item.coal.spoil_ticks = 600
end

And the full list is:
quality :: bool
rail_bridges :: bool
space_travel :: bool
spoiling :: bool
freezing :: bool
segmented_units :: bool
expansion_shaders :: bool

But again the most important takeaway: Non-dlc-owners cannot load mods that enable the feature flag ever, so this mod lets non-dlc-owners load the main mod while having its dlc-requiring features only load if this optional tiny mod is loaded; instead of -shifting all the optional content- into an -extra- dlc-requiring mod.

New response