Jump to content
Sign in to follow this  
max1944

add Primary Weapon Item to cfgVehicle ? (need help)

Recommended Posts

Hello

 

Is it possible to add a primary weapon item to a cfgVehicle unit? 

 

I would like to give CTRG Miller a custom weapon: (black MXC rifle with silencer and nightstalker scope).

 

addPrimaryWeaponItem seems not to work and adding a custom loadout for every mission and cutscene is a pain in the ass. I would rather like to patch the cfgVehicle.

 

I would appreciate any help

Share this post


Link to post
Share on other sites
class CfgWeapons {
	class arifle_MXC_Black_F;
	
	class YourTag_arifle_MXC_Black_F : arifle_MXC_Black_F{
		scope = protected;
		
		class LinkedItems {
			class LinkedItemsOptic {
				slot = "CowsSlot";
				item = "opticclassname";
			};
                        
                         class LinkedItemsMuzzle {
                                slot = "MuzzleSlot";
                                item = "silencerclassname"
		};
	};
};

You just have to replace the classnames (and "YourTag" too...) by the scope and silencer you want to use. Then in CfgVehicles you put the new weapon class you created in weapons[] 

 

Hope that helps 

  • Like 1

Share this post


Link to post
Share on other sites

Thank you very much. It worked with this code:

class CfgPatches 
{
	class cfgWeapons_Mod
	{
		units[] = {};
		weapons[] = {};
		requiredVersion = 0.1;
		requiredAddons[] = {"A3_Weapons_F"};
	};
};

class CfgWeapons 
{
	class arifle_MXC_Black_F;
	
	class arifle_MXC_Black_NST_pointer_snds_F : arifle_MXC_Black_F
	{
		class LinkedItems
		{
			class LinkedItemsOptic
			{
				slot = "CowsSlot";
				item = "optic_Nightstalker";
			};
			class LinkedItemsMuzzle
			{
				slot = "MuzzleSlot";
				item = "muzzle_snds_H";
			};
			class LinkedItemsAcc
			{
				slot = "PointerSlot";
				item = "acc_pointer_IR";
			};
		};
	};
};

Finally the CTRG guys are equiped properly by default:

 

SOLVED: (There is just one minor thing: Does someone know how to remove/change the goggles/sunglasses on cfgVehicles? (I dislike the yellow sport shades on McKay)) 

 

image.php?id=56b81424f7d5354d63931b71c4d

Share this post


Link to post
Share on other sites

You're welcome. Glad I could help  :)

 

for the classes you can do something like this

class CfgPatches {
	class elg_replacement_glasses {
		units[] = {};
 		weapons[] = {};
 		requiredVersion = 0.1;
 		requiredAddons[] = {"rhsusf", "rhs"};
 	};
 };	
 
 class CfgGlasses {
 
    class None;
    class G_Combat : None {
        identityTypes[] =
        {
            "NoGlasses",0,"G_NATO_default",0,"G_NATO_casual",0,"G_NATO_pilot",0,"G_NATO_recon",0,"G_NATO_SF",0,"G_NATO_sniper",0,
            "G_NATO_diver",0,"G_IRAN_default",0,"G_IRAN_diver",0,"G_GUERIL_default",00,"G_HAF_default",0,"G_CIVIL_female",0,"G_CIVIL_male",0
        };
    };

And there is an explanation of how facewear works here: https://community.bistudio.com/wiki/Arma_3_Characters_And_Gear_Encoding_Guide#Facewear_configuration

  • Like 1

Share this post


Link to post
Share on other sites

I noticed the glasses for individual characters are defined in cfgIdentities, but I don't know how to patch it.

 

I don't know the requiredAddons and there are no parents.

class CfgPatches 
{
	class cfgIdentities_Mod
	{
		units[] = {};
		weapons[] = {};
		requiredVersion = 0.1;
		requiredAddons[] = {???};
	};
};

class cfgIdentities
{
	class EPA_B_McKay
	{
		nameSound = "McKay";
		face = "WhiteHead_02";
		glasses = "G_Combat";
	};
};

Share this post


Link to post
Share on other sites

For these 5 guys you can also define their glasses in the unit parameters as linkedItems

 

For miller it would be something like this

	class B_story_SF_Captain_F : B_Soldier_base_F {
		LinkedItems[] = {"V_PlateCarrierL_CTRG","ItemMap","ItemCompass","ItemWatch","ItemRadio", "G_Aviator"};
		respawnLinkedItems[] = {"V_PlateCarrierL_CTRG","ItemMap","ItemCompass","ItemWatch","ItemRadio", "G_Aviator"};
 		};	
	};

and you can find the others in the config viewer, classnames are B_CTRG_xxxx_F

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  

×