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
a month ago
2.0
3.02K
Factorio: Space Age Icon Space Age Mod

g Question of understanding

a month 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?

a month 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.

a month ago
(updated a month 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? ;-)

a month ago
(updated a month 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.

a month ago
(updated a month ago)

Edit: -got doubleposted-

a month ago

thank you very much for the super detailed explanation

a month ago
(updated a month 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.

20 days ago

So if I'm understanding it correctly the DLC's features are only enabled if a currently enabled mod requests the feature to be enabled in the info.json? If that is the case that is annoying and after thinking on it for a few days I can't come up with anything better way than the current situation. Well, other than Wube having made this mod an internal core mod like the rest of the DLC in the first place.

19 days ago

no IMHO the mod which implements a feature sets a feature flag to true.
Elevated Rails activates "rail_bridges", Quality activates "quality", Space Age activates all above
or also "Enable all Feature Flags" activates all above.
The info.json only reqests that a feature must be activated to load the mod.
In other words, a set flag does not mean that a “feature” is implemented the way Wube does with the DLC mods.
A mod could implement its own version. In the case of “Enable all Feature Flags”, a minimal version that doesn't do much, except to make sure that mods that need the feature still work.
but that's just my personal interpretation, no guarantee of correctness ;-)

15 days ago
(updated 15 days ago)

According to this: https://forums.factorio.com/viewtopic.php?t=120083
Properties that require the DLC should just keep the default value.
I setup a test mod:
data.raw.armor["power-armor"].provides_flight = feature_flags["space_travel"]

without having any requirements specified in info.json, this mod works when not owning the DLC.
Can anyone check if it also works with DLC?

15 days ago

Why shouldn't that work?
more interesting would be what happens with
data.raw.armor[“power-armor”].provides_flight = true
if you don't own DLC?

15 days ago
(updated 15 days ago)

"Armor based flight is disabled and can not be used. Armor based flight requires space-travel."

If my example works with DLC, this is the proof that this mod is useless.

15 days ago
(updated 15 days ago)

IMHO is it not useles ;-)
You reference this mod only in your mod, if you want your mod to require the DLC without loading the mods of the DLC.
at least that's how I use it

15 days ago
(updated 15 days ago)

you mean, that makes my example usable with flighting armors but without any of the DLC mods activated?
is space-travel the name of one of the DLC mods?

14 days ago

if you own the DLC, I would this assume. BUT it will not be the case for all properties that a simple activation will produce full functionality. this depends on the internal implementation. for many things, several components will need to be present.

New response