In PR, we attach the distant sound to the muzzle flash effect and set it so it can be heard for an extremely long distance. Hopefully this will explain it for you mate.....
There's only four separate distant sounds we use in PR (9mm, 5.56, 7.62 and 50cal). Reason being that when you hear a distant gunshot in real life, you can only audibly distinguish the calibre (not so much the specific weapon).
Step 1: Check the weapons muzzle flash ==
You can define what muzzle flash effect a weapon is using in it's tweak file.
Note that this M16 is using the "e_muzz_m4" effect for it's muzzle flash.
Step 2: Attach your distant sound to the weapons muzzle flash effect
Navigate to the muzzle flash effects folder : "objects_server-zip\Effects\weapons\muzzleflashes\emitters"
and open up the appropriate muzzle flash effect, in this case "e_muzz_m4". In the code below, there's a sound template already in place on all the muzzle flash effects in BF2 (they just don't have any sound attached to them). So here's how the sound template for it looks in PR.....
ObjectTemplate.activeSafe Sound S_e_muzz_m4_Start
ObjectTemplate.modifiedByUser "Brian Hernandez"
Step 3: Balancing distances ==
You want to have it set up so that at close/medium ranges, you hear the 3p firing sound of the weapon. While at long ranges, you hear the distant sound. In PR, it's set up like so....
M16 3p firing sound (coming from the rifle)
(the actual wav is very loud)
ObjectTemplate.minDistance 3 (played at max volume for thirty meters)*
ObjectTemplate.halfVolumeDistance 10 (played at half volume for one hundred meters)*
5.56mm distant sound (coming from the rifle's muzzle flash effect)
(the actual wav is very quiet)
ObjectTemplate.minDistance 1 (only at max volume for ten meters)*
ObjectTemplate.halfVolumeDistance 300 (played at half volume for one hundred meters)*
*bare in mind that the distance absorption effect takes care making things seem a little more realistic in terms of how the sounds fade out.
So, out to 100m you hear the actual 3p firing sound of the M16 itself. You don't hear the distant sound because it's too quiet in comparison and is drowned out at close ranges. However, when it gets up to 100m+ away from you, the 3p firing sound will die off and all that's left is the distant sound.
Step 4: Correcting phase
I won't bore you with why this happens, but unless the sounds are coming from the exact same position, they will have conflicts with each other. So to correct this in PR, we set all the 3p firing sounds to come from the exact same position as the muzzle flash effect (which is where the distant sound is coming from).
If you look at the code in step one, you'll see the position for the muzzle flash effect "ObjectTemplate.setPosition -0.00513785/0.0539762/0.595038". Just take value and set the "ObjectTemplate.position" on the 3p firing sound to be the exact same.