Parented sound?

Discussion in 'Mapping Questions & Discussion' started by dragonbanshee, Mar 1, 2015.

  1. dragonbanshee

    dragonbanshee L1: Registered

    Messages:
    7
    Positive Ratings:
    0
    So I'm not sure if this is possible, but Ive been wanting to make an ambient_generic "follow" a player such that only the player can hear it. This would be achieved by the player walking into a trigger_hurt and then the sound is parented to the player. If this is possible how would I go about doing it?

    I've already tried using an env_entity_maker to create it but it doesn't seem to help.
     
  2. Izotope

    aa Izotope Never releases maps

    Messages:
    615
    Positive Ratings:
    573
    People nearby can still hear that sound.
    If you want to make only one person to hear a sound, use a point_clientcommand with this input:

    OnTrigger | clientcommand | Command | play directory/sound.extension
     
    • Thanks Thanks x 1
  3. dragonbanshee

    dragonbanshee L1: Registered

    Messages:
    7
    Positive Ratings:
    0
    This works fine, thanks a lot. Is there any way to stop the sound once someone leaves the trigger? Apparently "stop" isn't a command.
     
  4. Lampenpam

    aa Lampenpam

    Messages:
    1,019
    Positive Ratings:
    337
    If the play command is used again, the file from the previous command will stop immediately. So use the output again with a non-existing file

    OnTrigger | clientcommand | Command | play rainbows
     
    • Thanks Thanks x 1
  5. Izotope

    aa Izotope Never releases maps

    Messages:
    615
    Positive Ratings:
    573
    I believe Valve has a file called null.wav which is empty
     
  6. dragonbanshee

    dragonbanshee L1: Registered

    Messages:
    7
    Positive Ratings:
    0
    Oh cool, I didn't know that. Thanks a lot!


    Another problem I'm running into: If I go into the trigger, go out, go in again, go out, and then go in again and go out, after the 3rd time the sound will not stop and will continue to play until it ends.

    Also another problem is that when I die in the trigger, the sound will continue to play until it ends as well.
     
  7. Izotope

    aa Izotope Never releases maps

    Messages:
    615
    Positive Ratings:
    573
    OnStartTouch | clientcommand | Command | play sound
    OnEndTouch | clientcommand | Command | play null
     
  8. dragonbanshee

    dragonbanshee L1: Registered

    Messages:
    7
    Positive Ratings:
    0
    That's what I did. But I said that the problem is that the sound continues to play after I died inside the trigger, and after the second time of leaving and entering the sound continues.

    Edit: Apparently it isn't just 2 times, it's completely random. And sometimes when I die inside of it the sound does stop, and other times it doesn't.
     
    Last edited: Mar 1, 2015