ULX

Author Topic: TTT Advanced End Round Music  (Read 58464 times)

0 Members and 1 Guest are viewing this topic.

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
TTT Advanced End Round Music
« on: January 10, 2014, 11:53:33 AM »
Someone asked me to make an end round music script the other day, I thought I'd share it with you all.
This script will stream music from any .mp3 URL source, whether it be .mp3s hosted on your webserver, or a link you found on mp3skull. 
Features include:
-Different tables for different win scenarios (inno, traitor, timeout)
-5 included ulx commands for various things such as playing urls sv/cl side, stopping urls and queuing songs
-Nice looking HUD overlay displaying the name of the sound playing at the end of the round
-Queue system: donators can queue up any url they want that will play at the end round. (3 minute cool down between requests, configurable) and input the name and artist for end round HUD viewing. Admins can remove any queued song.
-Derma GUI with tabs for viewing all sounds loaded into the script, and for viewing all queued sounds. In the music tab it will show the type of song (inno/traitor/timeout), the artist and song name, and the URL. In the queue tab you can see the name of the user who added the song, the song name, and the url. Right click on any entry for various options such as playing that url for the server, for yourself, stopping sounds for the server, stopping sounds for yourself / Playing queued song for server or yourself, and removing any queued song.
Hope some of you find this useful.

Instructions:
Extract the file into your addons/ulx/lua/ulx/modules/sh folder

Screenshots:
HUD Overlay: http://puu.sh/6gghR.jpg
Menu: http://puu.sh/6ggna.jpg
Music tab: http://puu.sh/6ggnR.jpg
Queuing a song:
     Step 1: http://puu.sh/6ggt1.bmp
     Step 2: http://puu.sh/6gguz.bmp
     Done: http://puu.sh/6ggxy.bmp
Queue: http://puu.sh/6ggAe.bmp
Cooldown: http://puu.sh/6ggMC.jpg
« Last Edit: January 12, 2014, 12:04:10 PM by Cobalt77 »

Offline Hot_tub

  • Newbie
  • *
  • Posts: 1
  • Karma: 1
Re: TTT Advanced End Round Music
« Reply #1 on: January 10, 2014, 12:03:58 PM »
Nifty  8)

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: TTT Advanced End Round Music
« Reply #2 on: January 10, 2014, 12:21:30 PM »
Thought about adding/modifying to make this a 'radio' feature for any gamemode?
Seems it's been a while. I've no idea if PlayX still works.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: TTT Advanced End Round Music
« Reply #3 on: January 10, 2014, 12:44:07 PM »
Thought about adding/modifying to make this a 'radio' feature for any gamemode?
Seems it's been a while. I've no idea if PlayX still works.
You can stream radio with sound.PlayURL. I'll make a radio addon, that sounds like a good idea.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: TTT Advanced End Round Music
« Reply #4 on: January 10, 2014, 02:56:46 PM »
Any way to mod this to work with the ULX YouTube Jukebox?
That or have its own YouTube system feature?
It'd help a lot if there is so I won't have to rip the MP3s off YT. :p
bw81@ulysses-forums ~ % whoami
Homepage

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: TTT Advanced End Round Music
« Reply #5 on: January 10, 2014, 03:30:01 PM »
Any way to mod this to work with the ULX YouTube Jukebox?
That or have its own YouTube system feature?
It'd help a lot if there is so I won't have to rip the MP3s off YT. :p
I have no idea how the youtube api works.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: TTT Advanced End Round Music
« Reply #6 on: January 10, 2014, 05:29:45 PM »
I have no idea how the youtube api works.
Ah. Okay.
I hope you don't mind if I modify the code for my own uses, do you? :P
bw81@ulysses-forums ~ % whoami
Homepage

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: TTT Advanced End Round Music
« Reply #7 on: January 10, 2014, 05:31:07 PM »
Ah. Okay.
I hope you don't mind if I modify the code for my own uses, do you? :P
Go ahead.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: TTT Advanced End Round Music
« Reply #8 on: January 10, 2014, 05:34:46 PM »
Go ahead.
Okay, thanks. I'll take a look and see what I can do.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: TTT Advanced End Round Music
« Reply #9 on: January 11, 2014, 02:53:35 PM »
Fixed an issue breaking team chat. PlayerSay is the crappiest hook ever made. It just breaks everything.

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: TTT Advanced End Round Music
« Reply #10 on: January 11, 2014, 08:13:13 PM »
Would it be possible to add a feature that calls sounds already existing on the server?

Sort of like how you can do it with the links, but with local sounds.
Out of the Garry's Mod business.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: TTT Advanced End Round Music
« Reply #11 on: January 12, 2014, 06:56:52 AM »
Would it be possible to add a feature that calls sounds already existing on the server?

Sort of like how you can do it with the links, but with local sounds.
"ulx playsound" maybe? You will still need to get the client to download the sound files though (using something like resource.AddFile), but that seems to be the easy way (command-wise).
« Last Edit: January 12, 2014, 10:18:10 AM by Decicus »
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: TTT Advanced End Round Music
« Reply #12 on: January 12, 2014, 08:47:28 AM »
Would it be possible to add a feature that calls sounds already existing on the server?

Sort of like how you can do it with the links, but with local sounds.
That defeats the whole purpose of this script. You host your sounds on a webserver and play them through urls so your clients don't have to download them and you can join in the server faster.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: TTT Advanced End Round Music
« Reply #13 on: January 12, 2014, 10:29:13 AM »
And I think the question was meant to relate to playing a local sound after the end of the round.
Cobalt, I think it would still be a nice feature; allow the user to choose whether they want URL or local sound.
Shouldn't be too difficult for the code to detect http in the beginning of the path and go URL, or if no http, presume local.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: TTT Advanced End Round Music
« Reply #14 on: January 12, 2014, 11:20:07 AM »
My server already has 30+ sounds, so I would prefer it to be able to play that way.

You don't have to do it, I only want it so I don't have to tell people what song it is.
Out of the Garry's Mod business.