Jump to content
Sign in to follow this  
Belbo

Override already modded cfg entry

Recommended Posts

Hi!

I've got a very basic question: If I have a weapon (let's say the LMG_Mk200_F) that is already being changed by a mod (let's saye ace³) but I want to make some config changes (like adding new magazines) to the weapon that override the changes made by the other mod or any other mods in general, how would I do that?

 

Additional question: I'm trying to add some magazines to a weapon with magazines[] += {"blabla"}, but it doesn't seem to work. Any ideas?

 

class CfgPatches
{
    class lmg_moremags
    {
        units[] = {};
        weapons[] = {};
        requiredVersion = 1.60;
        requiredAddons[] = {
			"A3_Weapons_F"
			,"A3_Weapons_F_Exp_Machineguns_LMG_03"
		};
    };
};

class CfgWeapons
{
	class LMG_03_base_F;
	class LMG_03_F: LMG_03_base_F {
		magazines[] += {
			"30Rnd_556x45_Stanag","30Rnd_556x45_Stanag_green","30Rnd_556x45_Stanag_red","30Rnd_556x45_Stanag_Tracer_Red","30Rnd_556x45_Stanag_Tracer_Green","30Rnd_556x45_Stanag_Tracer_Yellow"
		};
	};
};

 

Share this post


Link to post
Share on other sites

Add the mod's CfgPatches class to requiredAddons[] and it'll force your mod to load after the other mod, and patch on top of it

Share this post


Link to post
Share on other sites

Unfortunately that would mean that I'd have to put every mod that might alter the values for my weapon in there. Which would mean that every mod that might change these values would be a requirement.

That's a no can do.

Share this post


Link to post
Share on other sites

Alright. I got the magazines[] += {};-part working.

But I still got the problem that my configs are being overridden by quite some addons, to which I neither can't nor won't add dependencies to. Has anybody got an idea how to make sure that the additional magazines that should be added to a weapon are not deleted by any mod that comes along?

Share this post


Link to post
Share on other sites

The solution has already been posted from da13thMonkey.

 

Normaly mods dont delete any other objects. Only if you use/alter existing objects, that might happen. Easiest way to get around such a thing is to give them own classnames with their own configs. That means dont just edit existing magazines/weapons etc. but make new ones.

To take you above example: create your own weapon "belbo_LMG_03_F" and edit the magazines etc to your needs. It is very unlikely that any other mod will change something in your own classnames.

Share this post


Link to post
Share on other sites

But the question is:

If my mod alters some values and another mod alters the same values, while both have the same requiredAddons - why would the other be loaded after mine?

Share this post


Link to post
Share on other sites

In the past it was simple: Whichever mod was written last in the -mod= startup parameter list would be last in the load order. Unless cfgpatches overrode it saying to load mod X after mod Y.

I have no idea how things like the Arma 3 Launcher, PWS launcher etc. etc. handle the startup order for a selected modset though

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×