Jump to content
Sign in to follow this  
UltimateBawb

Replacing Weapons and Inheriting Traits

Recommended Posts

I'm trying to replace default weapons with the modded weapons (RH) so that NPC's will by default use them. I figured it would be easier to replace the weapon configs than the actual NPC 'vehicles,' so I've done the following to replace the AK-74 with an RH_74:

	class AK_74 {
	scope = public;
	opticsZoomInit = 0.375;
	dexterity = 1.5;
	model = "\RH_aks\RH_ak74.p3d";
	picture = "\RH_aks\inv\ak74.paa";
	UiPicture = "\CA\weapons\data\Ico\i_regular_CA.paa";
	displayName = "AK-74";
	reloadMagazineSound[] = {"\RH_aks\sound\ak74_reload.wss", 0.056234, 1, 20};
	modes[] = {"Single", "FullAuto"};
	magazines[] = {"30Rnd_545x39_AK","RH_30Rnd_545x39_AK74_SP","RH_30Rnd_545x39_AK74_PP","RH_30Rnd_545x39_AK74_TR","RH_30Rnd_545x39_AK74_SD","RH_45Rnd_545x39_mag"};
	descriptionShort = "The AK-74 is an assault rifle designed by Izhmash.<br/>Caliber: 5.45x39mm";
	weaponInfoType = "RscWeaponZeroing";
	discreteDistance[] = {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000};
	discreteDistanceInitIndex = 3;

	class Single : Mode_SemiAuto {
		begin1[] = {"\RH_aks\Sound\ak74.wss", 1.77828, 1, 1000};
		soundBegin[] = {"begin1", 1};
		reloadTime = 0.075;
		recoil = "RH_AKS74URecoil";
		recoilProne = "RH_AKS74URecoilProne";
		dispersion = 0.00175;
		minRange = 2;
		minRangeProbab = 0.5;
		midRange = 250;
		midRangeProbab = 0.9;
		maxRange = 400;
		maxRangeProbab = 0.1;
	};

	class FullAuto : Mode_FullAuto {
		begin1[] = {"\RH_aks\Sound\ak74.wss", 1.77828, 1, 1000};
		soundBegin[] = {"begin1", 1};
		reloadTime = 0.075;
		ffCount = 30;
		recoil = "RH_AKS74URecoil";
		recoilProne = "RH_AKS74URecoilProne";
		dispersion = 0.00175;
		minRange = 0.1;
		minRangeProbab = 0.9;
		midRange = 60;
		midRangeProbab = 0.7;
		maxRange = 100;
		maxRangeProbab = 0.4;
	};

	class Library {
		libTextDesc = "The AK-74 is a 5.45 mm assault rifle developed in the early 1970s in the Soviet Union by Mikhail Kalashnikov. It was the first Soviet rifle to be chambered in an intermediate rifle caliber. It was introduced into service in 1974 (used to equip, among others, Soviet forces engaged in the Afghanistan conflict). The weapon’s name is an abbreviation for Avtomat Kalashnikova model 1974.";
	};
};

Strangely, however, it seems that the units that should by default have this weapon spawn without ammo, and numerous errors regarding "displayNameShort" and reload animations appear. Certain other weapons don't even spawn with the units they should. Why is this, and if this is the incorrect way of replacing weapons, what should I do?

Share this post


Link to post
Share on other sites

I understand that, but when I change the class, any units that should have that weapon (the AK-74 in this case) spawn with the default weapon and no ammo (which had its class modified as well).

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  

×