Sound: ExampleWeaponConfig – Arma 3
<nowiki>
class CfgPatches //cfgPatches is the class that that gives your addon it's identity, more info on cfgPatches parameters can be found on the relevant community wiki page. { class ThisIsMyAddon { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"A3_Weapons_F","A3_Sounds_F","A3_Sounds_F_Mark"};
/* requiredAddons is important. It kind of answers the question "What addons do I load before loading this one?"
If your addon will overwrite certain data from the original arma3 config (that is mostly the case
with sound/asset REPLACEMENTS) you need to put the cfgPatches class here that contains the information that you are about to overwrite. For example most arma3 sounds are defined in a config that's cfgPatches class is "A3_Sounds_F". So if you want to overwrite data from there you need to put it into the requiredAddons array. If you want to change vehicle sounds, look in which cfgPatches they are configured and add that to requiredAddons. */
version = "0.01"; //not sure what this does, just leave it as it is author[] = {"Megagoth1702"}; //Your alias authorUrl = "URL"; //URL to your website/online presence }; };
class cfgSoundShaders //detailed Infos on cfgSoundShaders can be found in the relevant wiki pages {
//###################################### SHOTS ###################################### class yourRifle_Closure_SoundShader { samples[] = Template:"path\to\sound.wav",1; //you can use wav/wss/ogg, ogg will have a small delay before playback (not too good for weapons/explosions) volume = 0.4466836; //more info on this and other soundShader parameters are in the relevant wiki pages on soundShaders range = 5; }; class yourRifle_closeShot_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = 1.0; range = 50; rangeCurve = "closeShotCurve"; }; class yourRifle_midShot_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = 0.7943282; range = 1800; rangeCurve[] = {{0,0.2},{50,1},{300,0},{1800,0}}; }; class yourRifle_distShot_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = 1.0; range = 1800; rangeCurve[] = {{0,0},{50,0},{300,1},{1800,1}}; };
//###################################### TAILS ######################################
class yourRifle_tailInterior_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = "interior"; range = 500; limitation = 0; }; class yourRifle_tailTrees_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = "(1-interior/1.4)*trees/3"; range = 1800; limitation = 1; }; class yourRifle_tailForest_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = "(1-interior/1.4)*forest/3"; range = 1800; limitation = 1; }; class yourRifle_tailMeadows_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = "(1-interior/1.4)*(meadows/2 max sea/2)/3"; range = 1800; limitation = 1; }; class yourRifle_tailHouses_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = "(1-interior/1.4)*houses/3"; range = 1200; limitation = 1; }; class yourRifle_silencerShot_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = 1.0; range = 150; rangeCurve = "closeShotCurve"; }; class yourRifle_silencerTailForest_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = "(1-interior/1.4)*forest/3"; range = 150; rangeCurve[] = {{0,1},{150,0.3}}; limitation = 1; }; class yourRifle_silencerTailHouses_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = "(1-interior/1.4)*houses/3"; range = 150; rangeCurve[] = {{0,1},{150,0}}; limitation = 1; }; class yourRifle_silencerTailInterior_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = "interior"; range = 150; rangeCurve[] = {{0,1},{50,0.3},{150,0}}; limitation = 1; }; class yourRifle_silencerTailMeadows_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = "(1-interior/1.4)*(meadows/2 max sea/2)/3"; range = 150; rangeCurve[] = {{0,1},{150,0.3}}; limitation = 1; }; class yourRifle_silencerTailTrees_SoundShader { samples[] = Template:"path\to\sound.wav",1; volume = "(1-interior/1.4)*trees/3"; range = 150; rangeCurve[] = {{0,1},{150,0.3}}; limitation = 1; }; };
class cfgSoundSets //on more info about soundSets look at the relevant wiki pages { class Your_Rifle_Shot_SoundSet { soundShaders[] = {"yourRifle_Closure_SoundShader","yourRifle_closeShot_SoundShader","yourRifle_midShot_SoundShader","yourRifle_distShot_SoundShader","yourRifle_tailInterior_SoundShader"}; volumeFactor = 1.6; volumeCurve = "InverseSquare2Curve"; sound3DProcessingType = "WeaponMediumShot3DProcessingType"; distanceFilter = "weaponShotDistanceFreqAttenuationFilter"; spatial = 1; doppler = 0; loop = 0; }; class Your_Rifle_Tail_SoundSet { soundShaders[] = {"yourRifle_tailTrees_SoundShader","yourRifle_tailForest_SoundShader","yourRifle_tailMeadows_SoundShader","yourRifle_tailHouses_SoundShader"}; volumeFactor = 1; volumeCurve = "InverseSquare2Curve"; frequencyRandomizer = 1; sound3DProcessingType = "WeaponMediumShotTail3DProcessingType"; distanceFilter = "weaponShotTailDistanceFreqAttenuationFilter"; spatial = 1; doppler = 0; loop = 0; soundShadersLimit = 2; }; };
//###################################### GENERAL MODES FOR INHERITANCE ###################################### class Mode_SemiAuto; //sooner or later in weapon modding you are going to need to inherit from these classes so why not just put them here for future reference? class Mode_Burst; class Mode_FullAuto;
class cfgWeapons { class arifle_MX_Base_F: Rifle_Base_F { class Single: Mode_SemiAuto { sounds[] = {"StandardSound","SilencedSound"}; class BaseSoundModeType; class StandardSound: BaseSoundModeType { soundSetShot[] = {"Your_Rifle_Shot_SoundSet","Your_Rifle_Tail_SoundSet"}; }; class SilencedSound: BaseSoundModeType { soundSetShot[] = {"Your_Rifle_Shot_SoundSet","Your_Rifle_Tail_SoundSet"}; //this is wrong, obviously you would create your own silenced versions of soundShaders & sets and assign the SETS here }; }; class FullAuto: Mode_FullAuto { sounds[] = {"StandardSound","SilencedSound"}; class BaseSoundModeType; class StandardSound: BaseSoundModeType { soundSetShot[] = {"Your_Rifle_Shot_SoundSet","Your_Rifle_Tail_SoundSet"}; }; class SilencedSound: BaseSoundModeType { soundSetShot[] = {"Your_Rifle_Shot_SoundSet","Your_Rifle_Tail_SoundSet"}; //this is wrong, obviously you would create your own silenced versions of soundShaders & sets and assign the SETS here }; }; }; };