Jump to content
Sign in to follow this  
SAMstudios-3Dartist

Custom weapon sound

Recommended Posts

Hey!

I´m trying to make a gun use it´s own custom shooting sound.

But need help with the config to make it work. Now its uses MX rifles in arma 3 sounds.

I need help to use the right code. So any help is nice.

class CfgPatches {
class sam_870b {
	units[] = {};
	weapons[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {"A3_Weapons_F"};
};
};

class CfgMagazines {

class CA_Magazine;

class sam_7Rnd_B_Remington_74Slug : CA_Magazine {
	scope = 2;
	displayName = "12g Slug";
	ammo = "B_12Gauge_Slug";
	count = 7;
	initSpeed = 396;
	picture = "\a3\weapons_f\data\UI\m_12gauge_slugs_ca.paa";
	descriptionShort = "12g Slugs";
};

class sam_7Rnd_B_Remington_Pellets : CA_Magazine {
	scope = 2;
	displayName = "12g Buck";
	ammo = "B_12Gauge_Pellets";
	count = 7;
	initSpeed = 396;
	picture = "\a3\weapons_f\data\UI\m_12gauge_ca.paa";
	descriptionShort = "00buck";
	displayNameShort = "12g Buck";
};
};

class Mode_SemiAuto;	// External class reference
class Mode_Burst;	// External class reference
class Mode_FullAuto;	// External class reference
class SlotInfo;	// External class reference
class CowsSlot;	// External class reference
class PointerSlot;	// External class reference

class CfgWeapons {

class Rifle;	// External class reference

class Rifle_Base_F : Rifle {
	class WeaponSlotsInfo;	// External class reference
};
class UGL_F;	// External class reference

class sam_870b_iron : Rifle_Base_F {
	scope = 2;
	model = "\sam_870b\sam_870b";
	picture = "\sam_870b\data\UI\gear_m870_ca.paa";
//		UiPicture = "\CA\weapons\data\Ico\i_regular_CA.paa";
	magazines[] = {"sam_7Rnd_B_Remington_Pellets","sam_7Rnd_B_Remington_74Slug"};
               reloadsound[] = {"\sam_870b\sound\pump.wss", 0.0316228, 1, 20};
	displayname = "Remington 870B";
	distanceZoomMin = 50;
	distanceZoomMax = 50;
	handAnim[] = {"OFP2_ManSkeleton", "\sam_870b\anim\870b_handanim.rtm"};

	class WeaponSlotsInfo : WeaponSlotsInfo {
		mass = 7;

		class MuzzleSlot : SlotInfo {
			compatibleItems[] = {};
		};

		class CowsSlot : CowsSlot {
			compatibleItems[] = {"optic_aco", "optic_ACO_grn", "optic_Holosight","optic_sam_aimpoint"};
		};

		class PointerSlot : PointerSlot {
			compatibleItems[] = {};
		};
	};

	class ItemInfo {
		priority = 2;
		RMBhint = M870b;
		onHoverText = "TODO M870b DSS";
	};

	modes[] = {"Single", "single_medium_optics1", "single_far_optics2"};

	class Single : Mode_SemiAuto {
		begin1[] = {"A3\sounds_f\weapons\khaybar\khaybar_1.wav", 1.0, 1, 900};
		begin2[] = {"A3\sounds_f\weapons\khaybar\khaybar_2.wav", 1.0, 1, 900};
		soundBegin[] = {"begin1", 0.5, "begin2", 0.5};
		weaponSoundEffect = "DefaultRifle";
		reloadTime = 1;
		recoil = "recoil_single_trg";
		recoilProne = "recoil_single_prone_trg";
		dispersion = 0.00093;
		minRange = 2;
		minRangeProbab = 0.3;
		midRange = 250;
		midRangeProbab = 0.7;
		maxRange = 500;
		maxRangeProbab = 0.2;
	};

	class single_medium_optics1 : Single {
		requiredOpticType = 1;
		showToPlayer = 0;
		minRange = 2;
		minRangeProbab = 0.2;
		midRange = 550;
		midRangeProbab = 0.7;
		maxRange = 700;
		maxRangeProbab = 0.1;
		aiRateOfFire = 6;
		aiRateOfFireDistance = 600;
	};

	class single_far_optics2 : single_medium_optics1 {
		requiredOpticType = 2;
	};




	class Library {
		libTextDesc = "The Remington Model 870 is a U.S.-made pump-action shotgun manufactured by Remington Arms Company, Inc. It is widely used by the public for sport shooting, hunting, and self-defense. It is also commonly used by law enforcement and military organizations worldwide.";
	};
	descriptionShort = "Remington 870";

	dexterity = (0.5 + 3.75/(4.4 + 0.001) + 0/10);
	discreteDistance[] = {100};
	discreteDistanceInitIndex = 1;
};
};

class CfgVehicles {
class Box_NATO_Wps_F;	// External class reference

class SAM_AMMOBOX_ALL : Box_NATO_Wps_F {

	class TransportMagazines { 

		class _xx_sam_7Rnd_B_Remington_Pellets {
			magazine = "sam_7Rnd_B_Remington_Pellets";
			count = 100;
		};

		class _xx_sam_7Rnd_B_Remington_74Slug {
			magazine = "sam_7Rnd_B_Remington_74Slug";
			count = 100;
		};
	};

	class TransportWeapons  {
		class _xx_sam_870b_iron {
			weapon = sam_870b_iron;
			count = 2;
		};

	};
};
};

Share this post


Link to post
Share on other sites

class CfgPatches {
   class sam_870b {
       units[] = {};
       weapons[] = {};
       requiredVersion = 0.1;
       requiredAddons[] = {"A3_Weapons_F"};
   };
};

class CfgMagazines {

   class CA_Magazine;

   class sam_7Rnd_B_Remington_74Slug : CA_Magazine {
       scope = 2;
       displayName = "12g Slug";
       ammo = "B_12Gauge_Slug";
       count = 7;
       initSpeed = 396;
       picture = "\a3\weapons_f\data\UI\m_12gauge_slugs_ca.paa";
       descriptionShort = "12g Slugs";
   };

   class sam_7Rnd_B_Remington_Pellets : CA_Magazine {
       scope = 2;
       displayName = "12g Buck";
       ammo = "B_12Gauge_Pellets";
       count = 7;
       initSpeed = 396;
       picture = "\a3\weapons_f\data\UI\m_12gauge_ca.paa";
       descriptionShort = "00buck";
       displayNameShort = "12g Buck";
   };
};

class Mode_SemiAuto;    // External class reference
class Mode_Burst;    // External class reference
class Mode_FullAuto;    // External class reference
class SlotInfo;    // External class reference
class CowsSlot;    // External class reference
class PointerSlot;    // External class reference

class CfgWeapons {

   class Rifle;    // External class reference

   class Rifle_Base_F : Rifle {
       class WeaponSlotsInfo;    // External class reference
   };
   class UGL_F;    // External class reference

   class sam_870b_iron : Rifle_Base_F {
       scope = 2;
       model = "\sam_870b\sam_870b";
       picture = "\sam_870b\data\UI\gear_m870_ca.paa";
//        UiPicture = "\CA\weapons\data\Ico\i_regular_CA.paa";
       magazines[] = {"sam_7Rnd_B_Remington_Pellets","sam_7Rnd_B_Remington_74Slug"};
       reloadsound[] = {"\sam_870b\sound\pump.wss", 0.0316228, 1, 20};
       displayname = "Remington 870B";
       distanceZoomMin = 50;
       distanceZoomMax = 50;
       handAnim[] = {"OFP2_ManSkeleton", "\sam_870b\anim\870b_handanim.rtm"};

       class WeaponSlotsInfo : WeaponSlotsInfo {
           mass = 7;

           class MuzzleSlot : SlotInfo {
               compatibleItems[] = {};
           };

           class CowsSlot : CowsSlot {
               compatibleItems[] = {"optic_aco", "optic_ACO_grn", "optic_Holosight","optic_sam_aimpoint"};
           };

           class PointerSlot : PointerSlot {
               compatibleItems[] = {};
           };
       };

       class ItemInfo {
           priority = 2;
           RMBhint = M870b;
           onHoverText = "TODO M870b DSS";
       };

       modes[] = {"Single", "single_medium_optics1", "single_far_optics2"};

[b]        class Single : Mode_SemiAuto {
           begin1[] = {"\sam_870b\sound\Sound_s1", 1, 1, 1300};
           begin2[] = {"\sam_870b\sound\Sound_s2", 1, 1, 1300};
           begin3[] = {"\sam_870b\sound\Sound_s3", 1, 1, 1300};
           begin4[] = {"\sam_870b\sound\Sound_s4", 1, 1, 1300};
           soundBegin[] = {"begin1", 0.25, "begin2", 0.25, "begin3", 0.25, "begin4", 0.25};[/b]
           weaponSoundEffect = "DefaultRifle";
           reloadTime = 1;
           recoil = "recoil_single_trg";
           recoilProne = "recoil_single_prone_trg";
           dispersion = 0.00093;
           minRange = 2;
           minRangeProbab = 0.3;
           midRange = 250;
           midRangeProbab = 0.7;
           maxRange = 500;
           maxRangeProbab = 0.2;
       };

       class single_medium_optics1 : Single {
           requiredOpticType = 1;
           showToPlayer = 0;
           minRange = 2;
           minRangeProbab = 0.2;
           midRange = 550;
           midRangeProbab = 0.7;
           maxRange = 700;
           maxRangeProbab = 0.1;
           aiRateOfFire = 6;
           aiRateOfFireDistance = 600;
       };

       class single_far_optics2 : single_medium_optics1 {
           requiredOpticType = 2;
       };




       class Library {
           libTextDesc = "The Remington Model 870 is a U.S.-made  pump-action shotgun manufactured by Remington Arms Company, Inc. It is  widely used by the public for sport shooting, hunting, and self-defense.  It is also commonly used by law enforcement and military organizations  worldwide.";
       };
       descriptionShort = "Remington 870";

       dexterity = (0.5 + 3.75/(4.4 + 0.001) + 0/10);
       discreteDistance[] = {100};
       discreteDistanceInitIndex = 1;
   };
};

class CfgVehicles {
   class Box_NATO_Wps_F;    // External class reference

   class SAM_AMMOBOX_ALL : Box_NATO_Wps_F {

       class TransportMagazines { 

           class _xx_sam_7Rnd_B_Remington_Pellets {
               magazine = "sam_7Rnd_B_Remington_Pellets";
               count = 100;
           };

           class _xx_sam_7Rnd_B_Remington_74Slug {
               magazine = "sam_7Rnd_B_Remington_74Slug";
               count = 100;
           };
       };

       class TransportWeapons  {
           class _xx_sam_870b_iron {
               weapon = sam_870b_iron;
               count = 2;
           };

       };
   };
};

Try it like this maybe wink.png

Now you need to name either the sound files Sound_s1 - 4 or you rename the entries in the config. You can also use only 2 sounds or even more... like 20 if you like. You just need to adjust this value: soundBegin[] = {"begin1", 0.25, "begin2", 0.25, "begin3", 0.25, "begin4", 0.25};

If you have only two sounds, you go like: soundBegin[] = {"begin1", 0.5, "begin2", 0.5}; The numbers (0.5) should be, added together, always 1.

LJ

Edited by LordJarhead

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  

×