Jump to content
Sign in to follow this  
vertshader

Base Weapon Attribute Override

Recommended Posts

Is it possible to override the attributes of an existing weapon/item, without creating a brand new class that inherits/copies the original base class?  Say you just wanted to change the name or description of the FX-45 pistol, and keep everything else working as in the base game, with the same models/sounds etc.  The examples I've seen create a new class based off the original base game class (like FNX45 class), but I was curious if you can just modify specific attributes of an existing class, leaving everything else the same (also not having to add a new class type to the economy xml files).  Thanks!

Edited by vertshader
Shorten Question

Share this post


Link to post
Share on other sites

I haven't tryed but seems possible. I don't see why you couldn't change the name, attachements types or even bullets types of a existing gun...

What have you tryed before posting here ?

Share this post


Link to post
Share on other sites

I did get it to work eventually, I was having some problems including a stringtable.csv with the Addon Builder tool (Addon Builder option to include other file types like csv), and going between stable/experimental versions was messing me up but think I got it worked out now.  Here is config.cpp that seems to be working, though it only modifies the basic display name/description (on Experimental 1.04).

class CfgPatches
{
	class MyAddon_Pistols_FNX45
	{
		units[] = {};
		weapons[] =
		{
			"FNX45"
		};
		requiredVersion = 1.0;
		requiredAddons[] =
		{
			"DZ_Data",
			"DZ_Pistols"
		};
	};
};

class CfgWeapons
{
	class FNX45_Base;
	class FNX45: FNX45_Base
	{
		displayName="$STR_myaddon_cfgweapons_fnx450";		// read value from stringtable.csv included in mod
		descriptionShort="$STR_myaddon_cfgweapons_fnx451";	// read value from stringtable.csv included in mod
    };
};

 

Share this post


Link to post
Share on other sites
On 6/25/2019 at 4:04 PM, vertshader said:

I did get it to work eventually, I was having some problems including a stringtable.csv with the Addon Builder tool (Addon Builder option to include other file types like csv), and going between stable/experimental versions was messing me up but think I got it worked out now.  Here is config.cpp that seems to be working, though it only modifies the basic display name/description (on Experimental 1.04).


class CfgPatches
{
	class MyAddon_Pistols_FNX45
	{
		units[] = {};
		weapons[] =
		{
			"FNX45"
		};
		requiredVersion = 1.0;
		requiredAddons[] =
		{
			"DZ_Data",
			"DZ_Pistols"
		};
	};
};

class CfgWeapons
{
	class FNX45_Base;
	class FNX45: FNX45_Base
	{
		displayName="$STR_myaddon_cfgweapons_fnx450";		// read value from stringtable.csv included in mod
		descriptionShort="$STR_myaddon_cfgweapons_fnx451";	// read value from stringtable.csv included in mod
    };
};

 

have you try move that to server side? As a way to override without mod it self for client.

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  

×