Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

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
Sign in to follow this  

×