• How to increase the range of an CSoundPatch?
    4 replies, posted
I want to play a looping sound using a CSoundPatch, but the sound refuses to play if the distance is larger than roughly 2500 units. How would I increase this range? This is my code at the moment. [lua] self.Entity.Horn = CreateSound( self.Entity, Sound( "car/horn.wav" ) ) self.Entity.Horn:SetSoundLevel( 0.27 ) --0.27 = SNDLVL_GUNFIRE self.Entity.Horn:Play()[/lua] The sound loops and I want to stop it later, so I have to use CSoundPatch. However, when the entity is too far away, the sound doesn't play. Any ideas?
:confused:
Wait, are you sure 0.27 is SNDLVL_GUNFIRE? That looks horribly low to me. Oh, I see, you used Valve's wiki, if I remember correctly, the values in the sound level table are incorrect. SNDLVL_GUNFIRE is somewhere between SNDLVL_130dB and SNDLVL_140dB, so I guess its value should be about 135. Try that. [editline]09:02AM[/editline] Also, if the entity is too far away when you start playing it, you won't hear it even if you get closer, you have to stop it and play it again. At least according to the wiki. That's pretty damn problematic if that's the issue you're having, I have no idea how to fix it.
Sorry, you need to Log In to post a reply to this thread.