Music player in map controllable by buttons?

Discussion in 'Mapping Questions & Discussion' started by Daedryon, Dec 20, 2009.

  1. Daedryon

    Daedryon L3: Member

    Messages:
    134
    Positive Ratings:
    3
    I have a Counter Strike: Source map, something like "lego jailbreak".

    In the map they have a room that acts as a dance club, and there are 6 buttons you can press, and each one plays a different song (real hip hop songs) that everyone in the immediate area can hear.

    As you move further away from the source, you hear less and less.

    Is this possible in Team Fortress? I've got some songs I'd love to put on my server and have buttons to control them, such as "Like a Boss - Lonely Island".

    It would lead to great times:

    Speedhacker: I'M SPEEDHACKIN'! IM AWESOME!
    Me: Oh no you didn't
    *plays Like a Boss*
    Me: IM THE BOSS!
    *bans Speedhacker*
     
    Last edited: Dec 20, 2009
  2. The Political Gamer

    aa The Political Gamer

    Messages:
    4,468
    Positive Ratings:
    1,684
  3. megawac

    megawac L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    29
    Didnt you say the light spot was the last question?

    Should be possible.

    All you should need is env_soundscape(s) and a func_button(s) that trigger one soundscape and turns off the other five.

    Seeing its your server you have to allow +use console command, not sure the cvar youll have to find it
     
  4. Daedryon

    Daedryon L3: Member

    Messages:
    134
    Positive Ratings:
    3
    Alright. I found a guide on FPSBANANA, about using buttons to play sounds, and I think I've pretty much got everything setup.

    However, since the sound my button plays is Like a Boss by The Lonely Island, how will players on my server hear it?

    Do I upload the file to my server somewhere?

    I need to know how to make sure people on my server can hear the song play when I shoot the button, but I can't figure out how to make it work on the server.
     
  5. KarmaPolice

    KarmaPolice L3: Member

    Messages:
    108
    Positive Ratings:
    52
    Pakrat it into the bsp, I believe.
     
  6. Daedryon

    Daedryon L3: Member

    Messages:
    134
    Positive Ratings:
    3
    Ahh ok! Packrat it is.

    http://developer.valvesoftware.com/wiki/TF2/Creating_Audio_Playing_Buttons

    I made everything work perfectly. I'm still fixing up the article. I fixed the problem where the button wouldn't replay the sound after the sound finished. It was the "Delay before reset" part of the func_button. I had it set to 3 seconds, and when I set it to -1, it fixed everything.
     
    Last edited: Dec 21, 2009
  7. Micnax

    aa Micnax I maek map

    Messages:
    2,061
    Positive Ratings:
    1,396
    Just remember to compress your sounds, otherwise you'll have a huge file size :p