Jump to content
g00d69

PrimaryWeaponItem equiped on weapon in config.cpp?

Recommended Posts

hi

I'am actually configuring equipment for some units in the config.cpp

weapon doesn't have items equiped by default,but only in inventory ("optic_hamr" etc....)

is there a syntax for equip for example "optic_hamr" directly on the weapon in config.cpp? ?

here is a sample of my code :

weapons[] = {"FHQ_M4A1_BLK", "hgun_P07_F","Throw","Put","Binocular"};

magazines[] = {"30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","16Rnd_9x21_Mag","16Rnd_9x21_Mag","HandGrenade","HandGrenade","HandGrenade","SmokeShell","SmokeShell"};

respawnweapons[] = {"FHQ_M4A1_BLK","hgun_P07_F","Throw","Put","Binocular"};

respawnmagazines[] = {"30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","30rnd_556x45_STANAG","16Rnd_9x21_Mag","16Rnd_9x21_Mag","HandGrenade","HandGrenade","SmokeShell","SmokeShell"};

items[] = {"FirstAidKit", "NVGoggles","optic_hamr","acc_flashlight","optic_carryhandle"};

linkeditems[] = {"V_PlateCarrier1_cbr","A_Hip_Beanie","ItemMap","ItemCompass","ItemWatch","ItemRadio"};

respawnitems[] = {"FirstAidKit"};

respawnlinkeditems[] = {"V_PlateCarrier1_cbr","A_Hip_Beanie","ItemMap","ItemCompass","ItemWatch","ItemRadio"};

Thanks for help

Share this post


Link to post
Share on other sites

It doesn't work that way. If you want to add a gun with certain attachments, you have to do it by making a new weapon entry in cfgWeapons.

You would then add your new weapon to weapons[]. You don't need to mention the individual gun parts in the soldier config.

class arifle_MX_ACO_point_gripod_mzls_F : arifle_MX_F
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_ACO";
		};

		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_pointer_IR";
		};
	};
};

thats what a gun config looks like when you are simply changing the attachments. "arifle_MX_F" is the base model, you would add "arifle_MX_ACO_point_gripod_mzls_F" to your soldier and it would have the attachments from your custom gun.

Share this post


Link to post
Share on other sites
It doesn't work that way. If you want to add a gun with certain attachments, you have to do it by making a new weapon entry in cfgWeapons.

You would then add your new weapon to weapons[]. You don't need to mention the individual gun parts in the soldier config.

class arifle_MX_ACO_point_gripod_mzls_F : arifle_MX_F
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_ACO";
		};

		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_pointer_IR";
		};
	};
};

thats what a gun config looks like when you are simply changing the attachments. "arifle_MX_F" is the base model, you would add "arifle_MX_ACO_point_gripod_mzls_F" to your soldier and it would have the attachments from your custom gun.

Thank you very much for help, its working now :)

Share this post


Link to post
Share on other sites

hey guys,

I am trying to get that script to work with the other custom stuff I have done to a weapon. Can anyone see what I have done wrong? The item is showing in the VA with no errors, but the attacments are not coming up. I am trying to add a scope, flashlight, bipod and suppressor

class AEF_weapon_mx_sw_bk: arifle_MX_SW_F
	{
		scope = 2;   
		author = "Duck";
		baseWeapon = "AEF_weapon_mx_sw_bk";
		displayName = "(AEF) MX SW Custom";
    		hiddenSelections[] = {"camo1"};
		hiddenSelectionsTextures[] = {"aef_weapons\arms\Data\aef_mxsw_blk.paa"};
		picture = "\A3\Weapons_F_EPB\Rifles\MX_Black\Data\UI\gear_mx_lmg_black_X_CA.paa";
		//compatibleitems[] = {"aef_arco_scope_F"};
	};  
	class LinkedItems
	   {    
		class LinkedItemsOptic
		    {     
			slot = "CowsSlot";
			item = "optic_Hamr";
		    };
		class LinkedItemAcc
		    { 
			slot = "PointerSlot";
			item = "acc_flashlight";
		    };
	   };
 };

Share this post


Link to post
Share on other sites

Sorry to revive an age old topic but I'm having a similar problem, I'm only trying to add a torch but it just seems to not load, does the accesory have to be in the same config as the weapon trying to use it/them?
 

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

×