1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Making specific players hear specific sounds.

Discussion in 'Programming' started by Techno JF, Mar 7, 2002.

  1. Techno JF

    Techno JF He Who Has Powerful Words

    Joined:
    Apr 8, 2001
    Messages:
    961
    Likes Received:
    0
    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.
     
  2. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,910
    Likes Received:
    35
    Call ClientPlaySound() for any PlayerPawn that should hear it.
     
  3. Techno JF

    Techno JF He Who Has Powerful Words

    Joined:
    Apr 8, 2001
    Messages:
    961
    Likes Received:
    0
    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.
     
  4. TaoPaiPai

    TaoPaiPai Commisaire Van Loc

    Joined:
    Jun 13, 2000
    Messages:
    1,626
    Likes Received:
    0
    You can increase the sound volume by playing the sound in more than one sound_slot.
     

Share This Page