Jump to content
Sign in to follow this  
sunrrrise

Properties shadowing - how to change item's name?

Recommended Posts

Hi,

I am struggling with properties shadowing. I am trying to change some of Massi's weapons from his pack (for my personal use!) but it doesn't work for me. I am using third method of this guide cause I think it is the same case:

 

https://community.bistudio.com/wiki/Arma_3_Characters_And_Gear_Encoding_Guide#Inheritance

 

My code goes like this:

 

config.cpp

#include "CfgPatches.hpp"
#include "CfgWeapons.hpp"

CfgPatches.hpp:

class CfgPatches
{
    class sun_weapons
    {
	author="sunrrrise"
        units[]={};
        weapons[]=
		{
			"arifle_mas_hk416"
		};
	requiredAddons[]={};
        requiredVersion=1.48;
    };
};

CfgWeapons.hpp:

class cfgWeapons
{
	class arifle_MX_F;
	class arifle_mas_hk416: arifle_MX_F
	{
		displayname = "HK416 A5 14.5''";
	};
}; 

And this is Massi's definition:

class CfgWeapons
{
	class Rifle;
	class Rifle_Base_F;
	class WeaponSlotsInfo;
	class GunParticles;
	class UGL_F;
	class arifle_MX_Base_F;
	class arifle_MX_F;
	class srifle_EBR_F;
	class arifle_TRG21_F;
	class optic_Hamr;
	class optic_Arco;
	class optic_Aco;
	class hgun_P07_F;
	class LMG_Mk200_F;
	class srifle_LRR_F;
	class srifle_GM6_F;
	class LMG_Zafir_F;
	class SMG_02_F;
	class hgun_PDW2000_F;
	class arifle_mas_hk416: arifle_MX_F
	{
		author="massi & authors in credits";
		_generalMacro="arifle_mas_hk416";
		displayname="HK416";
		model="\mas_us_rifle\mas_hk416";
		reloadAction="GestureReloadSMG_02";
		handanim[]=
		{
			"OFP2_ManSkeleton",
			"\mas_us_rifle\Anim\Handanim_416.rtm"
		};
		hiddenselections[]={};
		hiddenselectionstextures[]={};
		hiddenunderwaterselections[]={};
		hiddenunderwaterselectionstextures[]={};
		magazines[]=
		{
			"30Rnd_mas_556x45_Stanag",
			"30Rnd_mas_556x45sd_Stanag",
			"30Rnd_mas_556x45_T_Stanag",
			"30Rnd_556x45_Stanag",
			"30Rnd_556x45_Stanag_Tracer_Red",
			"30Rnd_556x45_Stanag_Tracer_Green",
			"30Rnd_556x45_Stanag_Tracer_Yellow",
			"20Rnd_556x45_UW_mag"
		};
		picture="\mas_us_rifle\ui\gear_hk416_x_ca.paa";
		descriptionshort="Assault Rifle<br />Caliber: 5.56x45 mm";
		class Library
		{
			libtextdesc="The Heckler & Koch HK416 is an assault rifle designed and manufactured by Heckler & Koch. It uses the AR-15 platform, originally conceived as an improvement to the Colt M4 carbine family issued to the U.S. military, with the notable inclusion of an HK-proprietary short-stroke gas piston system derived from the Heckler & Koch G36. USSOCOM and other country's Special Forces are equipped with the HK416, it fires the .223 caliber, or 5.56mm NATO round.";
		};
		class WeaponSlotsInfo: WeaponSlotsInfo
		{
			class MuzzleSlot: MuzzleSlot
			{
				linkProxy="\A3\data_f\proxies\weapon_slots\MUZZLE";
				iconPicture="\mas_us_rifle\ui\attachment_muzzle.paa";
				iconPosition[]={0,0.40000001};
				iconPinpoint="Center";
				compatibleItems[]=
				{
					"muzzle_snds_M",
					"muzzle_mas_snds_M",
					"muzzle_mas_snds_Mc"
				};
				iconScale=0.2;
			};
			class CowsSlot: CowsSlot
			{
				linkProxy="\A3\data_f\proxies\weapon_slots\TOP";
				iconPicture="\mas_us_rifle\ui\attachment_top2.paa";
				iconPosition[]={0.5,0.30000001};
				iconPinpoint="Bottom";
				compatibleitems[]=
				{
					"optic_Arco",
					"optic_aco",
					"optic_ACO_grn",
					"optic_hamr",
					"optic_Holosight",
					"optic_mas_acog",
					"optic_mas_acog_eo",
					"optic_mas_acog_rd",
					"optic_mas_aim",
					"optic_mas_handle",
					"optic_mas_zeiss",
					"optic_mas_zeiss_eo",
					"optic_mas_acog_c",
					"optic_mas_acog_eo_c",
					"optic_mas_acog_rd_c",
					"optic_mas_aim_c",
					"optic_mas_zeiss_c",
					"optic_mas_zeiss_eo_c",
					"optic_SOS",
					"optic_MRCO",
					"optic_Aco_smg",
					"optic_Holosight_smg",
					"optic_mas_term",
					"optic_NVS",
					"optic_Nightstalker",
					"optic_tws",
					"optic_mas_Holosight_blk",
					"optic_mas_Arco_blk",
					"optic_DMS",
					"optic_LRPS",
					"optic_mas_DMS",
					"optic_mas_DMS_c",
					"optic_mas_Holosight_camo",
					"optic_mas_Arco_camo",
					"optic_mas_Hamr_camo",
					"optic_mas_Aco_camo",
					"optic_mas_ACO_grn_camo",
					"optic_mas_MRCO_camo",
					"optic_mas_LRPS",
					"optic_AMS_khk",
					"optic_AMS_snd",
					"optic_AMS",
					"optic_KHS_blk",
					"optic_KHS_hex",
					"optic_KHS_old",
					"optic_KHS_tan"
				};
				iconScale=0.2;
			};
			class PointerSlot: PointerSlot
			{
				linkProxy="\A3\data_f\proxies\weapon_slots\SIDE";
				iconPicture="\mas_us_rifle\ui\attachment_side.paa";
				iconPinpoint="Center";
				iconPosition[]={0.2,0.40000001};
				compatibleitems[]=
				{
					"acc_flashlight",
					"acc_pointer_IR",
					"acc_mas_pointer_IR",
					"acc_mas_pointer_IR_top",
					"acc_mas_pointer_IR2",
					"acc_mas_pointer_IR2_top",
					"acc_mas_pointer_IR2c",
					"acc_mas_pointer_IR2c_top",
					"acc_mas_pointer_IR_b",
					"acc_mas_pointer_IR_top_b"
				};
				iconScale=0.2;
			};
			class UnderBarrelSlot: UnderBarrelSlot
			{
				linkProxy="\A3\Data_f_Mark\proxies\weapon_slots\UNDERBARREL";
				iconPicture="\mas_us_rifle\ui\attachment_bipod.paa";
				iconPinpoint="Center";
				iconPosition[]={0.2,0.80000001};
				compatibleitems[]=
				{
					"bipod_01_F_snd",
					"bipod_01_F_blk",
					"bipod_01_F_mtp",
					"bipod_02_F_blk",
					"bipod_02_F_tan",
					"bipod_02_F_hex",
					"bipod_03_F_blk",
					"bipod_03_F_oli"
				};
				iconScale=0.2;
			};
			mass=80;
		};
	};

What am I doing wrong? No errors during binarizing, making pbo file, mod is loading properly but it is still "HK416".

 

Can you help me with that? I tried to look at ACE realistic names config files as well as AGM's ones and everything seems to be correct but it's not. 

 

 

Share this post


Link to post
Share on other sites

This is where load-order of your mods comes into play. Try loading your new PBO in a seperate mod-folder to your Massi addons, and load it AFTER Massi's addons

e.g. -mod=@Massi;@MyRenameOfStuff

 

Read da12thmonkey's reply instead :)

Share this post


Link to post
Share on other sites

This is where load-order of your mods comes into play. Try loading your new PBO in a seperate mod-folder to your Massi addons, and load it AFTER Massi's addons

e.g. -mod=@Massi;@MyRenameOfStuff

 

If you put the addon you're trying to patch under the requiredAddons[] array, load order shouldn't matter. The game will process your config after it processes the original addon.

 

Filling out the requiredAddons[] array is a necessary part of any config that inherits classes from another config.

 

Also, you don't need "arifle_mas_hk416" in the weapons[] array of your addon's cfgPatches since massi's addon should have already added it. The units[] and weapons[] arrays only need NEW classnames you're adding.

  • Like 1

Share this post


Link to post
Share on other sites

If you put the addon you're trying to patch under the requiredAddons[] array, load order shouldn't matter. The game will process your config after it processes the original addon.

 

Filling out the requiredAddons[] array is a necessary part of any config that inherits classes from another config.

 

Also, you don't need "arifle_mas_hk416" in the weapons[] array of your addon's cfgPatches since massi's addon should have already added it. The units[] and weapons[] arrays only need NEW classnames you're adding.

Quite true. My brain lapsed back in time by about 10 years. Whoops :P

Share this post


Link to post
Share on other sites

Bump with another question!

 

Since BIS is going to implement EDen pretty soon (at least I hope so!) I want to make all "my" weapons be available in it. Unfortunatelly it looks more complicated - here is my code:

class CfgWeapons
{
	class arifle_mas_m4;
	class arifle_mas_m4_v: arifle_mas_m4
	{
		scope = 2;
		scopeCurator = 2;
		displayName = "M4A1 (W)";
		magazines[]=
		{
			"ACE_30Rnd_556x45_Stanag_Mk318_mag",
			"ACE_30Rnd_556x45_Stanag_Mk262_mag",
			"ACE_30Rnd_556x45_Stanag_M995_AP_mag"
		};

	};
        [more definitions]
};

Theoretically it should work:

 

http://steamcommunity.com/sharedfiles/filedetails/?id=530685341

 

but they are still not showing up in 2D/3D editor as a standalone items. What am I doing wrong? Or perhaps scope/scopeCurator is fixed and cannot be shadowed? 

Share this post


Link to post
Share on other sites

So far I know, the weapons and items in the editor are different from the weapon items a player can have in it's inventory.

 

For example:

 

Editor UAV Terminal:

Item_B_UavTerminal

The classname of the items the player can have in its inventory however is:

B_UavTerminal

So I guess you would need to create a new entry in CfgVehicles, however I don't know how to link it to your actual weapon then.

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  

×