Jump to content
Sign in to follow this  
alleycat

sound replacement failing

Recommended Posts

class CfgWeapons {
class Rifle;

class LeeEnfield : Rifle
               {
               htMin=1;
               htMax=420;
               afMax=0;
               mfMax=0;
               mFact=1;
               tBody=100;
               scope=2;
               displayName="Lee Enfield";
               model="\CA\weapons_E\LeeEnfield\LeeEnfield_no4mk1";
               picture="\ca\weapons_E\Data\icons\leeEnfield_CA.paa";
               UiPicture="\CA\weapons\data\Ico\i_sniper_CA.paa";
               handAnim[]={"OFP2_ManSkeleton","\Ca\weapons_E\Data\Anim\LeeEnfield.rtm"};
               dexterity=1.61;
               magazines[]={"10x_303"};
               opticsDisablePeripherialVision=0;
               opticsPPEffects[]={};
               distanceZoomMin=300;
               distanceZoomMax=300;
               minRange=0;
               minRangeProbab=0.1;
               midRange=150;
               midRangeProbab=0.7;
               maxRange=300;
               maxRangeProbab=0.05;
               aiRateOfFire=8;
               aiRateOfFireDistance=600;
               dispersion=0.0005;
               class Library
                       {
                       libTextDesc="The iconic Lee-Enfield rifle, the Mk III, was introduced on 26 January 1907 and featured a simplified rear sight arrangement and a fixed, rather than a bolt-head-mounted sliding, charger guide.The Mk III saw extensive service throughout the World War and Second World War as well. <br/>The SMLE Mk III uses the ,303 caliber ammo.";
                       };

               descriptionShort="Army rifle<br/>Caliber: ,303";
			//begin1[]={"Ca\Sounds_E\Weapons_E\Enfield\Enfield_4",1.77828,1,1500};
               begin1[]={"items\sounds\enfield_fire",1.77828,1,1500};
               soundBegin[]={"begin1",1};
               reloadMagazineSound[]={"Ca\sounds\Weapons\rifles\M1014-reload",0.01,1,20};
               drySound[]={"Ca\sounds\Weapons\rifles\dry",0.01,1,10};
               reloadTime=2;
               backgroundReload=1;
               recoil="recoil_single_primary_6outof10";
               recoilProne="recoil_single_primary_prone_5outof10";
               value=1000;
               };




};

Overwritten enfield rifle to use my new sound file. There is no compiler error, but the old sound plays.

The file is placed like this:

@addonname\addOns\items\sounds\enfield_fire (addon name being items.pbo)

1. Is the path wrong?

2. Is it wrong that the file is a stereo wav with 48kh? The Wss guide says one can use wav.

3. Why is there no error pointing to a wrong path or unreadable file?

---------- Post added at 01:32 PM ---------- Previous post was at 12:38 PM ----------

I changed the displayed name and it had no effect ingame. Why is the engine ignoring this override?

---------- Post added at 01:38 PM ---------- Previous post was at 01:32 PM ----------

Derving a custom weapon off LeeEnfield works, but overriding it wont, is there some addon stepping over it? I only got basic OA stuff loaded and CBA

Edited by alleycat

Share this post


Link to post
Share on other sites

I can get around the problem by deriving a new weapon for each one that uses custom sounds, but that is totally ghetto. Any pointers what is wrong?

Share this post


Link to post
Share on other sites

What's you're CFGPatch? Are you putting the appropriate required addons? (aka the addon where the weapon your replacing originally exists)

Share this post


Link to post
Share on other sites

class CfgPatches 		{
class My_items	{
	units[] = {};
	weapons[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {};
};
};

That is the CFGPatches. If I add "weapons_e" to requiredAddons[] it still won't change anything

Edited by alleycat

Share this post


Link to post
Share on other sites

Kerc is right, requiredAddons must list the cfgPatches name of each pbo where stuff you wanna work with is stored.

The best approach to do this is unknown to me, i mostly just guess lol.

But without this you´ll run into problems most of the time.

Also, when replacing stuff you don´t carry over the whole config entry but only the lines you really changed (i.e. model/sound).

Otherwise, when an official patch changes something in the classes you worked with you´d still be running the outdated config.

Here´s my try at it (untested).

If it doesn´t wanna work you can try adding CAWeapons_E_LeeEnfield to requiredAddons but i don´t think its needed.

class CfgPatches 	{
class My_items	{
	units[] = {};
	weapons[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {"CAWeapons","CAWeapons_E"};
};
};
class CfgWeapons {
class Rifle;	
class LeeEnfield : Rifle {
               begin1[]={"items\sounds\enfield_fire",1.77828,1,1500};
               };
};

Share this post


Link to post
Share on other sites

ye that worked. thanks a lot. What I dont get is where that CAWeapons_E is. I assume you have to call the actual addon that represents the weapon (enfield is in weapons_e).

Also can the game mix definitions? Like 2 different mods redefining parts of the enfield, one doing the sounds and the other the magazine?

Share this post


Link to post
Share on other sites
ye that worked. thanks a lot. What I dont get is where that CAWeapons_E is. I assume you have to call the actual addon that represents the weapon (enfield is in weapons_e).

Assuming we´d want to reskin the ArmA2 M1A1, we´d then guess that all its componets are stored in tracked.pbo

If we open that pbo and unbin it´s config, the cfgPatches there is named CATracked - this is the one needed thing in requiredAddons.

(special case: we´d also want to change the editor icon of said tank, then we´d likely need cfgPatches name from misc.pbo aswell [i guess, again]).

There´s the funny part you see, if you wanna be thourough you´ll have to double check each and every config :D

I recommend the allInOne.cpp, you´ll have to search for it on devheaven, an invaluable tool for every addonmaker!

Also can the game mix definitions? Like 2 different mods redefining parts of the enfield, one doing the sounds and the other the magazine?

Perfectly possible if both addons configs are correctly made.

If one of the two carried whole config entries like in your first post it wouldn´t work.

Edited by Mr Burns

Share this post


Link to post
Share on other sites

	class Rifle;

class Mode_SemiAuto;
class Mode_Burst;
class Mode_FullAuto;

//class AK_BASE;

//class LeeEnfield;
class LeeEnfield : Rifle
               {
               htMin=1;
               htMax=420;
               afMax=0;
               mfMax=0;
               mFact=1;
               tBody=100;
               scope=2;
               displayName="Lee EnfieldC";
               model="\CA\weapons_E\LeeEnfield\LeeEnfield_no4mk1";
               picture="\ca\weapons_E\Data\icons\leeEnfield_CA.paa";
               UiPicture="\CA\weapons\data\Ico\i_sniper_CA.paa";
               handAnim[]={"OFP2_ManSkeleton","\Ca\weapons_E\Data\Anim\LeeEnfield.rtm"};
               dexterity=1.61;
               magazines[]={"10x_303"};
               opticsDisablePeripherialVision=0;
               opticsPPEffects[]={};
               distanceZoomMin=300;
               distanceZoomMax=300;
               minRange=0;
               minRangeProbab=0.1;
               midRange=150;
               midRangeProbab=0.7;
               maxRange=300;
               maxRangeProbab=0.05;
               aiRateOfFire=8;
               aiRateOfFireDistance=600;
               dispersion=0.0005;
               class Library
                       {
                       libTextDesc="The iconic Lee-Enfield rifle, the Mk III, was introduced on 26 January 1907 and featured a simplified rear sight arrangement and a fixed, rather than a bolt-head-mounted sliding, charger guide.The Mk III saw extensive service throughout the World War and Second World War as well. <br/>The SMLE Mk III uses the ,303 caliber ammo.";
                       };

               descriptionShort="Army rifle<br/>Caliber: ,303";
			//begin1[]={"Ca\Sounds_E\Weapons_E\Enfield\Enfield_4",1.77828,1,1500};
               begin1[]={"\cobra_items\sounds\enfield_fire",1.77828,1,1500};
               soundBegin[]={"begin1",1};
               reloadMagazineSound[]={"Ca\sounds\Weapons\rifles\M1014-reload",0.01,1,20};
               drySound[]={"Ca\sounds\Weapons\rifles\dry",0.01,1,10};
               reloadTime=2;
               backgroundReload=1;
               //recoil="recoil_single_primary_6outof10";
			recoil="recoil_single_primary_6outof10";
               recoilProne="recoil_single_primary_prone_5outof10";
               value=1000;
               };





       class AK_BASE : Rifle
               {
               scope=0;
               value=0;
               model="";
               displayName="";
               optics=1;
               drySound[]={"ca\sounds\weapons\rifles\dry",0.000316228,1,10};
               reloadMagazineSound[]={"ca\sounds\weapons\rifles\reload-ak-2ivan",0.0707946,1,20};
               modes[]={"FullAuto","Single","Burst"};
               magazines[]={"30Rnd_545x39_AK","30Rnd_545x39_AKSD"};
               bullet1[]={"ca\sounds\weapons\shells\small_shell_metal_04",0.177828,1,15};
               bullet2[]={"ca\sounds\weapons\shells\small_shell_metal_03",0.177828,1,15};
               bullet3[]={"ca\sounds\weapons\shells\small_shell_metal_02",0.177828,1,15};
               bullet4[]={"ca\sounds\weapons\shells\small_shell_metal_01",0.177828,1,15};
               bullet5[]={"ca\sounds\weapons\shells\small_shell_dirt_07",0.316228,1,15};
               bullet6[]={"ca\sounds\weapons\shells\small_shell_dirt_09",0.316228,1,15};
               bullet7[]={"ca\sounds\weapons\shells\small_shell_dirt_10",0.316228,1,15};
               bullet8[]={"ca\sounds\weapons\shells\small_shell_dirt_12",0.316228,1,15};
               bullet9[]={"ca\sounds\weapons\shells\small_shell_soft_05",0.177828,1,15};
               bullet10[]={"ca\sounds\weapons\shells\small_shell_soft_09",0.177828,1,15};
               bullet11[]={"ca\sounds\weapons\shells\small_shell_soft_10",0.177828,1,15};
               bullet12[]={"ca\sounds\weapons\shells\small_shell_soft_13",0.177828,1,15};
               soundBullet[]={"bullet1",0.083,"bullet2",0.083,"bullet3",0.083,"bullet4",0.083,"bullet5",0.083,"bullet6",0.083,"bullet7",0.083,"bullet8",0.083,"bullet9",0.083,"bullet10",0.083,"bullet11",0.083,"bullet12",0.083};
               class Single : Mode_SemiAuto
                       {
                       begin1[]={"ca\sounds\weapons\rifles\AK74_single2",1.77828,1,1000};
                       soundBegin[]={"begin1",1};
                       reloadTime=0.1;
                       recoil="recoil_single_primary_4outof10";
                       recoilProne="recoil_single_primary_prone_4outof10";
                       dispersion=0.00125;
                       minRange=2;
                       minRangeProbab=0.3;
                       midRange=250;
                       midRangeProbab=0.7;
                       maxRange=400;
                       maxRangeProbab=0.04;
                       };

               class Burst : Mode_Burst
                       {
                       begin1[]={"ca\sounds\weapons\rifles\AK74_single2",1.77828,1,1000};
                       soundBegin[]={"begin1",1};
                       soundBurst=0;
                       reloadTime=0.1;
                       ffCount=3;
                       recoil="recoil_auto_primary_3outof10";
                       recoilProne="recoil_auto_primary_prone_3outof10";
                       dispersion=0.00125;
                       minRange=1;
                       minRangeProbab=0.3;
                       midRange=80;
                       midRangeProbab=0.7;
                       maxRange=120;
                       maxRangeProbab=0.05;
                       showToPlayer=0;
                       };

               class FullAuto : Mode_FullAuto
                       {
                       begin1[]={"ca\sounds\weapons\rifles\AK74_single2",1.77828,1,1000};
                       soundBegin[]={"begin1",1};
                       reloadTime=0.1;
                       ffCount=30;
                       recoil="recoil_auto_primary_4outof10";
                       recoilProne="recoil_auto_primary_prone_4outof10";
                       dispersion=0.00125;
                       minRange=0;
                       minRangeProbab=0.1;
                       midRange=25;
                       midRangeProbab=0.7;
                       maxRange=70;
                       maxRangeProbab=0.05;
                       };



               };				

	class AK_47_M : AK_BASE
               {

               class Single : Mode_SemiAuto
                       {
                       begin1[]={"\cobra_items\sounds\ak47_fire",1.77828,1,1000};
                       soundBegin[]={"begin1",1};

                       };

               class Burst : Mode_Burst
                       {
                       begin1[]={"\cobra_items\sounds\ak47_fire",1.77828,1,1000};
                       soundBegin[]={"begin1",1};
                       soundBurst=0;

                       };

               class FullAuto : Mode_FullAuto
                       {
                       begin1[]={"\cobra_items\sounds\ak47_fire",1.77828,1,1000};
                       soundBegin[]={"begin1",1};
                       reloadTime=0.1;

                       };

               };	

Compiles but it is raining errors ingame.

Warning Message: No entry 'bin\config.bin/CfgWeapons/AK_74/FullAuto.displayName'.
Warning Message: '/' is not a value
Warning Message: No entry 'bin\config.bin/CfgWeapons/AK_74/FullAuto.multiplier'.
Warning Message: '/' is not a value
Warning Message: No entry 'bin\config.bin/CfgWeapons/AK_74/FullAuto.burst'.
Warning Message: '/' is not a value
Warning Message: No entry 'bin\config.bin/CfgWeapons/AK_74/FullAuto.autoFire'.
Warning Message: '/' is not a value
Warning Message: No entry 'bin\config.bin/CfgWeapons/AK_74/FullAuto.aiRateOfFire'.
Warning Message: '/' is not a value
Warning Message: No entry 'bin\config.bin/CfgWeapons/AK_74/FullAuto.aiRateOfFireDistance'.
Warning Message: '/' is not a value
Warning Message: No entry 'bin\config.bin/CfgWeapons/AK_74/FullAuto.soundContinuous'.
Warning Message: '/' is not a value
Warning Message: No entry 'bin\config.bin/CfgWeapons/AK_74/FullAuto.soundBurst'.
Warning Message: '/' is not a value
Warning Message: No entry 'bin\config.bin/CfgWeapons/AK_74/FullAuto.useAction'.
Warning Message: '/' is not a value
Warning Message: No entry 'bin\config.bin/CfgWeapons/AK_74/FullAuto.useActionTitle'.

HOW THE FUCK DO I CLEANLY CLONE A FUCKING AK WITH MINIMAL FUCKING INHERITANCE SHIT. WITHOUT IT REPORTING 500 MILLION ERRORS ALTHOUTH IT SHOULD BE FUCKING STRAIGHTFORWARD LIKE THIS. WHY DOES THIS SHIT NEVER WORK ON THE FIRST ATTEMPT

.. if anyone could point out what is methodically messed up every time I try to clone a gun it would be nice

wasnt it supposed to be like this:

class baseweapon_it_fucking_inherits_from;

class AK47

Share this post


Link to post
Share on other sites

Not sure if this will help, but I always use scope = public when I inherit stuff. I think you also need to include "#define public 2" above your cfgpatches. (or you could just do "scope = 2")

Share this post


Link to post
Share on other sites

Where should I write the scope?

Also can someone show how to correctly inherit a FN FAL without having to copy paste the entire rifle class because fn fal inherits M16 which needs M203 muzzle and I got lost tracking that down. Now I got ~6 pages worth of copypasted classes trying to find what is missing.

Share this post


Link to post
Share on other sites










class Mode_SemiAuto;
class Mode_Burst;
class Mode_FullAuto;
class CfgWeapons {

class Rifle;
class M16A2;


       class FN_FAL : M16A2
               {
               class Single : Single
                       {
                       begin1[]={"\cobra_items\sounds\enfield_fire",1.77828,1,1500};
                       begin2[]={"\cobra_items\sounds\enfield_fire",1.77828,1,1500};
                       soundBegin[]={"begin1",0.5,"begin2",0.5};
                       };

               class Burst : Burst
                       {
                       dispersion=0.0005;
                       begin1[]={"\cobra_items\sounds\enfield_fire",1.77828,1,1500};
                       begin2[]={"\cobra_items\sounds\enfield_fire",1.77828,1,1500};
                       soundBegin[]={"begin1",0.5,"begin2",0.5};
                       };
               };	

This is the code for the fn fal clone. the problem is the fire modes deriving seems to fail but the classes they depend on are included above

---------- Post added at 06:02 PM ---------- Previous post was at 05:46 PM ----------

Adding the classes above fixed it.

Share this post


Link to post
Share on other sites

class CfgVehicles {

class TK_GUE_Soldier_Base_EP1;
class TK_GUE_Soldier_4_EP1;// latest definition of hitpoints in this class.






   class New_Soldier : TK_GUE_Soldier_4_EP1
   {
       displayName = "New Soldier";
              class HitPoints : HitPoints
                       {
                       class HitHead : HitHead
                               {
                               armor=0.85;
                               };

                       class HitBody : HitBody
                               {
                               armor=1;
                               passThrough=0.8;
                               };

                       };
   }; 

/CfgVehicles/New_Soldier.HitPoints: Undefined base class 'HitPoints'

Earliest definition of Hitpoints is in AllVehicles, of which TK_GUE is a child class SO WHY THE FK WONT THIS WORK?

---------- Post added at 05:20 PM ---------- Previous post was at 04:56 PM ----------

class CfgVehicles {

class All;
class AllVehicles;
class Land;
class Man;
class CAManBase;
class SoldierGB;
class TK_GUE_Soldier_Base_EP1;
class TK_GUE_Soldier_4_EP1;






   class New_Soldier : TK_GUE_Soldier_4_EP1

Added everything in the complete inheritance, still wont work.

Share this post


Link to post
Share on other sites

Have you tried the same procedure as with firing modes in cfgWeapons?

Just a shot into the blue :D

class HitPoints;
class HitHead;
class HitBody;

class CfgVehicles {
class TK_GUE_Soldier_4_EP1;

   class New_Soldier : TK_GUE_Soldier_4_EP1 {
       displayName = "New Soldier";
              class HitPoints : HitPoints {
                       class HitHead : HitHead {
                               armor=0.85;
                               };
                       class HitBody : HitBody {
                               armor=1;
                               passThrough=0.8;
                               };
                       };
   };

PS: When replacing units aswell, make sure you have the corresponding CAWhatever in your reuqired addons array!

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  

×