ID:263041
 
Code:
            var/sound/S = sound('SFX/Guns/ar416/ar_shoot.wav')
S.environment = 16
S.falloff = 20
S.volume = rand(185,200)
src.mob.icon_state = "ar416 - fire"
src.mob.shooting = 1
src.mob<< S
turnangle = rand(6,-6)
new/obj/Bullet(src.mob.loc, TurnAngle(angle,turnangle), src.mob)
spawn() Recoil(src.mob, 1,3)
for(var/mob/M in range(35,src.mob))
if(M == src.mob) continue
if(!M) continue
S.x = (src.mob.x - M.x)/2
S.y = (src.mob.y - M.y)/2
S.environment = 17
M<< S


Problem description:

Whatever mobs that are in range 35 of src.mob will not hear the sound unless they are within 10 tiles of src.mob.
I've tried changing the Falloff var, and decreasing the sound's X and Y vars (as you can see by the "/2"). No difference. At all!
Range() is limited to world.view, which is limited to 10.
In response to Jp
Wow... thanks. That explains a lot!
Mind you that unless your map is side-view like a sidescroller or underwater/sky/space, your sound is going to sound like it's coming from the wrong spot. A better formula:
S.x = mob.x - M.x
S.y = (mob.y - M.y)/sqrt(2)
S.z = S.y

Lummox JR
In response to Lummox JR
This is for a top view game... like one of my older games, PoA, or like Malver's Bizlof War...
In response to D4RK3 54B3R
D4RK3 54B3R wrote:
This is for a top view game... like one of my older games, PoA, or like Malver's Bizlof War...

Then you definitely do not want to assign sound.y the entire y distance, because that'll make the sound seem like it's above you. The formula I posted will split the difference between y and z as if you're looking down onto the map at an angle, which meshes much better with the player's internal conception of it.

Lummox JR