PDA

View Full Version : Making specific players hear specific sounds.


Techno JF
7th Mar 2002, 10:04 AM
Here's the effect I'm going for. When a player touches a certain actor in a level, the player makes a sound that only he can hear. (I figure that the player actually needs to make the sound, because I don't want him to be able to move out of hearing range and miss the latter parts of the sound. I'm being cautious and saying that the sound can be as long as 5 seconds in duration.) Meanwhile, the touched object makes a different sound that everyone in hearing range except the touching player can hear.

Is there a way to prevent a sound played in the world from being heard by a specific player? I'm pretty sure that there's an easy way to do this, but I'm not at all versed in the ways of controlling sound with UScript.

Wormbo
7th Mar 2002, 10:32 AM
Call ClientPlaySound() for any PlayerPawn that should hear it.

Techno JF
7th Mar 2002, 12:09 PM
Thanks for the heads-up about the ClientPlaySound function. I tracked it all back to the PlaySound function in the base Actor class. However, after taking a look at it, I think I'm going to have to do a little math with this function. (i.e. to simulate distance from the actor by lowering volume) I was hoping I could just use the engine's native functions for determining sound audibility, and then find a way to block the instigator of the sound from hearing it.

TaoPaiPai
7th Mar 2002, 12:16 PM
You can increase the sound volume by playing the sound in more than one sound_slot.