Jump to content
Bayern_Maik

Sound Replacement Config / "Undefined base class `Mode_SemiAuto'.

Recommended Posts

Hi,

I am trying to get into that config replacement stuff.

At the moment i have a problem with sound replacement.

I am trying to give a Modgun a vanilla sound (P07), but cant get it done and iam running out of ideas how this could work else...

When launching Arma with my replacement config, i get the error "Undefined base class `Mode_SemiAuto'.

This is the code inside the CfgWeapons in my replacement config file:

 

Quote

class Pistol;    // External class reference
    
    class Pistol_Base_F : Pistol {
        class WeaponSlotsInfo;    // External class reference
    };
    
    class Modgun : Pistol_Base_F {
    class Single : Mode_SemiAuto {


            sounds[] = {"StandardSound", "SilencedSound"};
            class BaseSoundModeType;    // External class reference
            
            class StandardSound : BaseSoundModeType {
                soundSetShot[] = {"P07_Shot_SoundSet","P07_Tail_SoundSet","P07_InteriorTail_SoundSet"};
            };
            
            class SilencedSound : BaseSoundModeType {
                soundSetShot[] = {"P07_silencerShot_SoundSet","P07_silencerTail_SoundSet","P07_silencerInteriorTail_SoundSet"};
            };
        

};

};

As far as i get it, you basically "overwrite" the initial mod config file with your replacement file.

It worked sofar with all parameters, except the sound

I have no clue where the class "Mode_SemiAuto" directs to.

It somehow works when i throw this code directly into the original mod config file, thats why i really dont understand why my replacement config with the same code wont....

 

I guess its a noob caused issue and hope you guys can help me out.

I can give more info if needed.

 

Sry for english mistakes & greets from Germany ;)

Share this post


Link to post
Share on other sites
class Pistol;    // External class reference
    
	class Mode_SemiAuto;
    class Pistol_Base_F : Pistol {
        class WeaponSlotsInfo;    // External class reference
    };
    
    class Modgun : Pistol_Base_F {
    class Single : Mode_SemiAuto {

            sounds[] = {"StandardSound", "SilencedSound"};
            class BaseSoundModeType;    // External class reference
            
            class StandardSound : BaseSoundModeType {
                soundSetShot[] = {"P07_Shot_SoundSet","P07_Tail_SoundSet","P07_InteriorTail_SoundSet"};
            };
            
            class SilencedSound : BaseSoundModeType {
                soundSetShot[] = {"P07_silencerShot_SoundSet","P07_silencerTail_SoundSet","P07_silencerInteriorTail_SoundSet"};
            };
        
	};
};

Mode semi-auto has to be declared up top. See the new config.

 

You are welcome to use my Pistol Config template posted below.

 

change class names as needed to fit your needs. Works like a charm ;)

 

class CfgPatches 
{
	class Pistols_Rook18s
	{
		units[] = { };
		weapons[] = {"hgun_Rook18_Select_F"};
		requiredVersion = 0.1;
		requiredAddons[] = {"A3_Sounds_F","A3_Weapons_F"};
		version = ".08";
		ammo[]={"B_9x21_Buffalo_Bore_Ball"};
		magazines[]={"30Rnd_9x21_Buffalo_Bore_Mag"};
		projectName = "Rook Select Fire";
		author = "Project Genesis Team";
	};
};

class CfgAmmo {
		
	class B_580x42_Ball_F; // External class reference
	class B_9x21_Ball;	// External class reference
	class BulletBase; // External class reference
	
	class B_9x21_Buffalo_Bore_Ball : B_9x21_Ball {
		hit = 9.94265;
		nvgOnly=0;
		indirectHit = 0;
		indirectHitRange = 0;
		suppressionRadiusBulletClose = 2;
		cartridge = "FxCartridge_9mm";
		model = "\Rook18s\Auto\data\yellow.p3d";
		tracerScale = 0.03;
		caliber = 0.415;
		deflecting = 25;
		visibleFire = 1;
		audibleFire = 2.5;
		cost = 100;
		typicalSpeed = 390.1;
		airFriction = -0.001095;
	
		};
		
	};	
		
	class CfgMagazines {
			
		class CA_Magazine;	// External class reference
		class 30Rnd_9x21_Mag; // External class reference
		 
		class 30Rnd_9x21_Buffalo_Bore_Mag : 30Rnd_9x21_Mag {
		author="Project Genesis Team";
		picture = "\A3\weapons_f\data\ui\M_30Rnd_45ACP_CA.paa";
		ammo="B_9x21_Buffalo_Bore_Ball";
		scope=2;
		tracersEvery = 1;
		count = 30
		lastRoundsTracer=30;
		displayName="9mm 30Rnd +P+ Buffalo Bore";
		displayNameShort="9mm +P+ FMJ";
		descriptionShort = "Caliber: 9x21 +P+ Buffalo Bore FMJ<br />Rounds: 30<br />Used in: 9mm Pistols and submachineguns";
				
		};

	};



class Mode_SemiAuto;
class Mode_FullAuto;
class WeaponSlotsInfo;

class CfgWeapons
{
	class Pistol_Base_F;
	
	class hgun_Rook18_Select_F : Pistol_Base_F{
		scope = 2;
		model = "\Rook18s\Auto\data\rook40.p3d";
		picture ="\A3\weapons_F\Pistols\Rook40\data\UI\gear_Rook40_x_ca.paa";		
		magazines[] = {"30Rnd_9x21_Buffalo_Bore_Mag", "30Rnd_9x21_Mag", "30Rnd_9x21_Red_Mag", "30Rnd_9x21_Yellow_Mag", "30Rnd_9x21_Green_Mag","16Rnd_9x21_Mag", "16Rnd_9x21_red_Mag", "16Rnd_9x21_green_Mag", "16Rnd_9x21_yellow_Mag"};
		displayname = "Rook18 9MM Select Fire";
		discreteDistance[] = {100, 200};
		discreteDistanceInitIndex = 0;
		descriptionShort = "Rook18s";
		reloadAction = "GestureReloadPistol";
		opticsZoomMin = 0.375;
		opticsZoomMax = 1.1;
		opticsZoomInit = 0.75;
		distanceZoomMin = 50;
		distanceZoomMax = 50;
		changeFiremodeSound[] = {"A3\sounds_f\weapons\closure\firemode_changer_1", 0.251189, 1, 30};
		drySound[] = {"Rook18s\Auto\sounds\Rookdry.wss", 1, 1, 60};
		reloadMagazineSound[] = {"A3\Sounds_F\arsenal\weapons\Pistols\Rook40\reload_rook40", 1.0, 1, 40};
			
	class WeaponSlotsInfo : WeaponSlotsInfo {
			mass = 20;
			holsterScale = 0.95;
			
			class CowsSlot {};
			
			class PointerSlot {};
		};
	
	
	modes[] = {"Single", "FullAuto"};
	
	class Single: Mode_SemiAuto{
			reloadTime = 0.0545;
			recoil = "recoil_single_pdw";
			recoilProne = "recoil_single_prone_pdw";
			dispersion = 0.00435;
			minRange = 2;
			minRangeProbab = 0.3;
			midRange = 200;
			midRangeProbab = 0.7;
			maxRange = 350;
			maxRangeProbab = 0.05;
			aiRateOfFire = 2.0;
			aiRateOfFireDistance = 500;
			
			class BaseSoundModeType;
			class StandardSound: BaseSoundModeType
			{
				soundSetShot[] = {"PG_Rook_Tails_Trees_SoundSet","PG_Rook_Tails_Meadows_SoundSet","PG_Rook_Tails_Houses_SoundSet","PG_Rook_Shot_SoundSet","PG_Rook_Mid_SoundSet","PG_Rook_Dist_SoundSet","PG_Rook_Shell_SoundSet"};
			};
			class SilencedSound: BaseSoundModeType
			{
				soundSetShot[] = {"PG_Rook_Shot_Silenced_SoundSet","PG_Rook_Shell_SoundSet"};
			};
		};
		
		class FullAuto: Mode_FullAuto{
			reloadTime = 0.06;
			recoil = "recoil_auto_pdw";
			recoilProne = "recoil_auto_prone_pdw";
			dispersion = 0.065;
			minRange = 0;
			minRangeProbab = 0.1;
			midRange = 25;
			midRangeProbab = 0.7;
			maxRange = 70;
			maxRangeProbab = 0.05;
			aiRateOfFire = 1e-006;
			aiRateOfFireDistance = 50;

			class BaseSoundModeType;
			class StandardSound: BaseSoundModeType
			{
				soundSetShot[] = {"PG_Rook_Tails_Trees_SoundSet","PG_Rook_Tails_Meadows_SoundSet","PG_Rook_Tails_Houses_SoundSet","PG_Rook_Tails_Forest_SoundSet","PG_Rook_Interior_SoundSet","PG_Rook_Full_Auto_SoundSet","PG_Rook_Mid_SoundSet","PG_Rook_Dist_SoundSet","PG_Rook_Shell_SoundSet"};
			};
			class SilencedSound: BaseSoundModeType
			{
				soundSetShot[] = {"PG_Rook_Shot_Silenced_SoundSet","PG_Rook_Shell_SoundSet"};
			};
		};
	};
};
class CfgSoundSets
{
	class PG_Rook_Shot_SoundSet
	{
		soundShaders[] = {"PG_Rook_Closure_SoundShader","PG_Rook_close_Shot_SoundShader","PG_Rook_Interior_Shot_SoundShader","PG_Rook_mid_Shot_SoundShader", "PG_Rook_far_Shot_SoundShader"};
		volumeFactor = 1.495;
		volumeCurve = "InverseSquare2Curve";
		sound3DProcessingType = "WeaponMediumShot3DProcessingType";
		spatial = 1;
		doppler = 0;
		loop = 0;
		distanceFilter = "weaponShotDistanceFreqAttenuationFilter";
		occlusionFactor = 0.45;
		obstructionFactor = 0.35;
		frequencyRandomizer = 1;
	};

	class PG_Rook_Full_Auto_SoundSet
	{
		soundShaders[] = {"PG_Rook_Full_Auto_Shot_SoundShader","PG_Rook_Closure_SoundShader","PG_Rook_Interior_Shot_SoundShader","PG_Rook_mid_Shot_SoundShader","PG_Rook_far_Shot_SoundShader"};
		volumeFactor = 1;
		volumeCurve = "InverseSquare1Curve";
		sound3DProcessingType = "WeaponMediumShot3DProcessingType";
		spatial = 1;
		doppler = 0;
		loop = 0;
		soundShadersLimit = 3;
		distanceFilter = "weaponShotDistanceFreqAttenuationFilter";
		frequencyRandomizer = 3;
	};

	class PG_Rook_Interior_SoundSet
	{
		soundShaders[] = {"PG_Rook_Interior_Shot_SoundShader"};
		volumeFactor = 1;
		volumeCurve = "InverseSquare1Curve";
		sound3DProcessingType = "WeaponMediumShot3DProcessingType";
		spatial = 1;
		doppler = 0;
		loop = 0;
		soundShadersLimit = 1;
		distanceFilter = "weaponShotDistanceFreqAttenuationFilter";
		frequencyRandomizer = 1;
	};

	class PG_Rook_Tails_Trees_SoundSet
	{
		soundShaders[] = {"Rogue9_tailTrees_SoundShader"};
		volumeFactor = 1.5;
		volumeCurve = "InverseSquare2Curve";
		sound3DProcessingType = "WeaponMediumShot3DProcessingType";
		spatial = 1;
		doppler = 0;
		loop = 0;
		distanceFilter = "weaponShotDistanceFreqAttenuationFilter";
		occlusionFactor = 0.45;
		obstructionFactor = 0.35;
		frequencyRandomizer = 1;
	};
	
	class PG_Rook_Tails_Houses_SoundSet
	{
		soundShaders[] = {"Rogue9_tailHouses_SoundShader"};
		volumeFactor = 1.5;
		volumeCurve = "InverseSquare2Curve";
		sound3DProcessingType = "WeaponMediumShot3DProcessingType";
		spatial = 1;
		doppler = 0;
		loop = 0;
		distanceFilter = "weaponShotDistanceFreqAttenuationFilter";
		occlusionFactor = 0.45;
		obstructionFactor = 0.35;
		frequencyRandomizer = 1;
	};

	class PG_Rook_Tails_Meadows_SoundSet
	{
		soundShaders[] = {"Rogue9_tailMeadows_SoundShader"};
		volumeFactor = 1.5;
		volumeCurve = "InverseSquare2Curve";
		sound3DProcessingType = "WeaponMediumShot3DProcessingType";
		spatial = 1;
		doppler = 0;
		loop = 0;
		distanceFilter = "weaponShotDistanceFreqAttenuationFilter";
		occlusionFactor = 0.45;
		obstructionFactor = 0.35;
		frequencyRandomizer = 1;
	};

	class PG_Rook_Tails_Forest_SoundSet
	{
		soundShaders[] = {"Rogue9_tailForest_SoundShader"};
		volumeFactor = 1.5;
		volumeCurve = "InverseSquare2Curve";
		sound3DProcessingType = "WeaponMediumShot3DProcessingType";
		spatial = 1;
		doppler = 0;
		loop = 0;
		distanceFilter = "weaponShotDistanceFreqAttenuationFilter";
		occlusionFactor = 0.45;
		obstructionFactor = 0.35;
		frequencyRandomizer = 1;
	};
	
	class PG_Rook_Mid_SoundSet
	{
		soundShaders[] = {"PG_Rook_mid_Shot_SoundShader"};
		volumeFactor = 1;
		volumeCurve = "InverseSquare1Curve";
		sound3DProcessingType = "WeaponMediumShot3DProcessingType";
		spatial = 1;
		doppler = 0;
		loop = 0;
		soundShadersLimit = 3;
		distanceFilter = "weaponShotDistanceFreqAttenuationFilter";
		frequencyRandomizer = 3;
	};
	
	class PG_Rook_Dist_SoundSet
	{
		soundShaders[] = {"PG_Rook_far_Shot_SoundShader"};
		volumeFactor = 1;
		volumeCurve = "InverseSquare1Curve";
		sound3DProcessingType = "WeaponMediumShot3DProcessingType";
		spatial = 1;
		doppler = 0;
		loop = 0;
		soundShadersLimit = 3;
		distanceFilter = "weaponShotDistanceFreqAttenuationFilter";
		frequencyRandomizer = 3;
	};
	
	
	class PG_Rook_Shell_SoundSet
	{
		soundShaders[] = {"PG_Rook_Shell_Inroom_SoundShader"};
		volumeFactor = 1;
		volumeCurve = "InverseSquare2Curve";
		sound3DProcessingType = "WeaponMediumShot3DProcessingType";
		spatial = 1;
		doppler = 0;
		loop = 0;
		soundShadersLimit = 3;
		distanceFilter = "weaponShotDistanceFreqAttenuationFilter";
		frequencyRandomizer = 3;
	};
	class PG_Rook_Shot_Silenced_SoundSet
	{
		soundShaders[] = {"PG_Rook_Closure_SoundShader","PG_Rook_Interior_Silenced_SoundShader","PG_Rook_Shot_Silenced_SoundShader"};
		volumeFactor = 1.495;
		volumeCurve = "InverseSquare2Curve";
		occlusionFactor = 0.5;
		obstructionFactor = 0.5;
		sound3DProcessingType = "WeaponMediumShot3DProcessingType";
		spatial = 1;
		doppler = 0;
		loop = 0;
		distanceFilter = "weaponShotDistanceFreqAttenuationFilter";
		frequencyRandomizer = 1;
	};
};
class CfgSoundShaders
{
	class PG_Rook_Interior_Silenced_SoundShader
	{
		samples[] = {
		{ "\Rook18s\Auto\sounds\SD_Interior_1",1 },
		{ "\Rook18s\Auto\sounds\SD_Interior_2",1 }};
		volume = 1.3*interior;
		range = 65;
	};
	class PG_Rook_Interior_Shot_SoundShader
	{
		samples[] = {
		{ "\Rook18s\Auto\sounds\Shots\Interior_1.ogg",1 },
		{ "\Rook18s\Auto\sounds\Shots\Interior_2.ogg",1 },
		{ "\Rook18s\Auto\sounds\Shots\Interior_3.ogg",1 }};
		volume = "interior";
		range = 65;
	};
	
//----------------------------------------------------------------------------------------//
	
	class PG_Rook_Closure_SoundShader
	{
		samples[] = {
		{ "A3\Sounds_F\arsenal\weapons\Pistols\Rook40\Closure_Rook40_01",1 },
		{ "A3\Sounds_F\arsenal\weapons\Pistols\Rook40\Closure_Rook40_02",1 }};
		volume = 0;
		range = 0;
	};
	
	class PG_Rook_Full_Auto_Shot_SoundShader
	{
		samples[] = {
		{ "Rook18s\Auto\sounds\Pistol_1",1 },
		{ "Rook18s\Auto\sounds\Pistol_2",1 },
		{ "Rook18s\Auto\sounds\Pistol_3",1 }};
		volume = 1.8*(1-interior/1.4);
		range = 2500;
		rangeCurve[] = {{ 0,1 },{ 20,1 },{ 40,0 },{ 2500,0 }};
	};
	
	
	class PG_Rook_close_Shot_SoundShader
	{
		samples[] = {
		{ "Rook18s\Auto\sounds\Pistol_S1.ogg",1 },
		{ "Rook18s\Auto\sounds\Pistol_S2.ogg",1 },
		{ "Rook18s\Auto\sounds\Pistol_S3.ogg",1 }};
		volume = 1.8*(1-interior/1.4);
		range = 2500;
		rangeCurve[] = {{ 0,1 },{ 20,1 },{ 40,0 },{ 2500,0 }};
	};
	
	class PG_Rook_mid_Shot_SoundShader
	{
		samples[] = {
		{ "\Rook18s\Auto\sounds\Shots\Pistol_S1_Mid",1 },
		{ "\Rook18s\Auto\sounds\Shots\Pistol_S2_Mid",1 },
		{ "\Rook18s\Auto\sounds\Shots\Pistol_S3_Mid",1 }};
		volume = 2.00;
		range = 2500;
		rangeCurve[] = {{ 0,0 },{ 40,0 },{ 145,1 },{ 300,0 },{ 2500,0 }};
	};
	
	class PG_Rook_far_Shot_SoundShader
	{
		samples[] = {
		{ "\Rook18s\Auto\sounds\Shots\B_9x21_Ball_Dist_1",1 },
		{ "\Rook18s\Auto\sounds\Shots\B_9x21_Ball_Dist_2",1 },
		{ "\Rook18s\Auto\sounds\Shots\B_9x21_Ball_Dist_3",1 },
		{ "\Rook18s\Auto\sounds\Shots\B_9x21_Ball_Dist_4",1 },
		{ "\Rook18s\Auto\sounds\Shots\B_9x21_Ball_Dist_5",1 },
		{ "\Rook18s\Auto\sounds\Shots\B_9x21_Ball_Dist_6",1 }};
		volume = 2.50;
		range = 2500;
		rangeCurve[] = {{ 0,0 },{ 145,0 },{ 300,1 },{ 1000,0 },{ 2500,0 }};
	};
	
	class Rogue9_tailForest_SoundShader
	{
		samples[] = {{"\A3\Sounds_F_Exp\arsenal\weapons\SMGs\Rogue9\Rogue9_tailforest", 1}};
		volume = "(1-interior/1.4)*forest/3";
		range = 2000;
		rangeCurve[] = {{0, 1}, {2000, 0}};
		limitation = 1;
	};

	class Rogue9_tailHouses_SoundShader {
		samples[] = {{"\A3\Sounds_F_Exp\arsenal\weapons\SMGs\Rogue9\Rogue9_tailhouses", 1}};
		volume = "(1-interior/1.4)*houses/3";
		range = 1500;
		rangeCurve[] = {{0, 1}, {250, 0.3}, {1500, 0}};
		limitation = 1;
	};

	class Rogue9_tailMeadows_SoundShader {
		samples[] = {{"\A3\Sounds_F_Exp\arsenal\weapons\SMGs\Rogue9\Rogue9_tailmeadows", 1}};
		volume = "(1-interior/1.4)*(meadows/2 max sea/2)/3";
		range = 2000;
		rangeCurve[] = {{0, 1}, {2000, 0}};
		limitation = 1;
	};

	class Rogue9_tailTrees_SoundShader {
		samples[] = {{"\A3\Sounds_F_Exp\arsenal\weapons\SMGs\Rogue9\Rogue9_tailtrees", 1}};
		volume = "(1-interior/1.4)*trees/3";
		range = 2000;
		rangeCurve[] = {{0, 1}, {2000, 0}};
		limitation = 1;
	};
	
//----------------------------------------------------------------------------------------//
	
	class PG_Rook_Shot_Silenced_SoundShader
	{
		samples[] = {
		{ "\A3\sounds_f\weapons\Pistols\Silencer_Rook40_1",1 },
		{ "\A3\sounds_f\weapons\Pistols\Silencer_Rook40_2",1 }};
		volume = 1.8*(1-interior/1.4);
		range = 250;
	};
	class PG_Rook_tailInterior_Silenced_SoundShader
	{
		samples[] = {
		{ "\Rook18s\Auto\sounds\SD_Interior_1",1 },
		{ "\Rook18s\Auto\sounds\SD_Interior_2",1 },
		{ "\Rook18s\Auto\sounds\SD_Interior_3",1 }};
		volume = "interior";
		range = 50;
		limitation = 1;
	};
	
	class PG_Rook_Shell_Inroom_SoundShader
	{
		samples[] = {
		{ "\Rook18s\Auto\sounds\Casings\File_1",1 },
		{ "\Rook18s\Auto\sounds\Casings\File_2",1 },
		{ "\Rook18s\Auto\sounds\Casings\File_3",1 },
		{ "\Rook18s\Auto\sounds\Casings\File_4",1 },
		{ "\Rook18s\Auto\sounds\Casings\File_5",1 },
		{ "\Rook18s\Auto\sounds\Casings\shell_1",1 },
		{ "\Rook18s\Auto\sounds\Casings\shell_2",1 },
		{ "\Rook18s\Auto\sounds\Casings\shell_3",1 },
		{ "\Rook18s\Auto\sounds\Casings\shell_Concrete_1",1 },
		{ "\Rook18s\Auto\sounds\Casings\shell_Concrete_2",1 },
		{ "\Rook18s\Auto\sounds\Casings\shell_Concrete_3",1 }};
		volume = "interior";
		range = 20;
		limitation = 1;
	};
	
	
	
};

 

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

×