I'm trying to check to see if the user has some mods loaded, and I would prefer to do this in a config file, but I'm not sure the new way to do this is 0.13.
Specifically, I'm trying to check for a mod like Natural Convergence to add it's entities to a list for which I generate other items that spawn those entities. The check should probably occur in "config" which is then loaded by "entities" in the prototypes folder which is, in turn, loaded by the standard "data".
How does one check for specific mods installed? I see game.active_mods, but "game" is nil at the time of loading for "data.lua".
How to check for other mods in 0.13+?
- Versepelles
- Long Handed Inserter
- Posts: 70
- Joined: Sat May 28, 2016 1:42 pm
- Contact:
- DedlySpyder
- Filter Inserter
- Posts: 254
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: How to check for other mods in 0.13+?
You'll have to check to see if one if its entities exist (make it an optional dependency). That was the old way atleast, IIRC, so I assume it'll still work
Re: How to check for other mods in 0.13+?
I think you also need a soft dependency on that other mod, to make sure it loads before yours. Then you can just look to see if the thing you want to add support for exists, rather than checking if the mod is loaded.DedlySpyder wrote:You'll have to check to see if one if its entities exist (make it an optional dependency). That was the old way atleast, IIRC, so I assume it'll still work
- Ranakastrasz
- Smart Inserter
- Posts: 2179
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: How to check for other mods in 0.13+?
Presumably this has something to do with it.Added LuaGameScript::active_mods - a table of active mod names to mod versions.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
- DedlySpyder
- Filter Inserter
- Posts: 254
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: How to check for other mods in 0.13+?
You can't access game during the data loading phase thoughRanakastrasz wrote:Presumably this has something to do with it.Added LuaGameScript::active_mods - a table of active mod names to mod versions.
- Ranakastrasz
- Smart Inserter
- Posts: 2179
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: How to check for other mods in 0.13+?
Wut?
....
What is the point of adding that?
....
What is the point of adding that?
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
- DedlySpyder
- Filter Inserter
- Posts: 254
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: How to check for other mods in 0.13+?
So that you can check on_init. I have a mod that has arrays of entities, so I can check active mods after the game starts to correct any values in the arrays. LinkRanakastrasz wrote:Wut?
....
What is the point of adding that?
- Ranakastrasz
- Smart Inserter
- Posts: 2179
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: How to check for other mods in 0.13+?
I should say, why is it not set on program load instead? You can't change it without restarting, and it would fix the ridiculous mod checking method we use now...
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
- DedlySpyder
- Filter Inserter
- Posts: 254
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: How to check for other mods in 0.13+?
Why does active_mods not set on program load? I can't say for sure, I guess it's a matter of how would you access it otherwise? Data.raw only contains information for prototypes AFAIK, so they'd have to expand it to allow us to check it I guess.Ranakastrasz wrote:I should say, why is it not set on program load instead? You can't change it without restarting, and it would fix the ridiculous mod checking method we use now...