Ulysses
Ulysses Stuff => Releases => Topic started by: Cobalt 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 (http://puu.sh/6gghR.jpg)
Menu: http://puu.sh/6ggna.jpg (http://puu.sh/6ggna.jpg)
Music tab: http://puu.sh/6ggnR.jpg (http://puu.sh/6ggnR.jpg)
Queuing a song:
Step 1: http://puu.sh/6ggt1.bmp (http://puu.sh/6ggt1.bmp)
Step 2: http://puu.sh/6gguz.bmp (http://puu.sh/6gguz.bmp)
Done: http://puu.sh/6ggxy.bmp (http://puu.sh/6ggxy.bmp)
Queue: http://puu.sh/6ggAe.bmp (http://puu.sh/6ggAe.bmp)
Cooldown: http://puu.sh/6ggMC.jpg (http://puu.sh/6ggMC.jpg)
-
Nifty 8)
-
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.
-
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.
-
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
-
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.
-
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
-
Ah. Okay.
I hope you don't mind if I modify the code for my own uses, do you? :P
Go ahead.
-
Go ahead.
Okay, thanks. I'll take a look and see what I can do.
-
Fixed an issue breaking team chat. PlayerSay is the crappiest hook ever made. It just breaks everything.
-
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.
-
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 (http://wiki.garrysmod.com/page/resource/AddFile)), but that seems to be the easy way (command-wise).
-
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.
-
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.
-
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.
-
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.
I don't understand the reasoning behind this. It's really really simple to move your sounds to a webserver and link them in this addon. The whole point is that by not having downloads new players join the server so much faster. Also that you can quickly add new music.
It would require much more work for me to do this than for you to set it up with the way the addon is right now.
-
Update: Added a radio feature and slightly redesigned the queue tab.
-
The music is so loud players are complaining. I tried adjusting the clipped mp3 on my website but the addon/server seems to adjust it back up. I tried to adjust your code as follows but I must be doing something wrong. Can you let me know how I can fix this? Thanks.
sound.PlayURL( url, "", function( station )
if station and IsValid( station ) then
station:Play()
station:SetVolume( 100 )
LocalPlayer().channel = station
end
end )
-
The music is so loud players are complaining. I tried adjusting the clipped mp3 on my website but the addon/server seems to adjust it back up. I tried to adjust your code as follows but I must be doing something wrong. Can you let me know how I can fix this? Thanks.
sound.PlayURL( url, "", function( station )
if station and IsValid( station ) then
station:Play()
station:SetVolume( 100 )
LocalPlayer().channel = station
end
end )
Does any error at all print? Because if I've read the wiki correctly, that should work.
Also, for future reference, you should probably use the "code" BB tags if you're posting code like that.
-
No I get no errors whatsoever! I just cant figure it out.
-
Perhaps it's just on the client's side? ???
-
Not sure what you mean but I have this on 4 servers and everyone is complaining it is too loud. I believe it is certainly serverside. It's a shame because this is a wonderful addon but the volume level makes it rather unusable.
-
The example showed on the wiki page of sound.PlayURL (http://wiki.garrysmod.com/page/sound/PlayURL) seems to be wrong.
SetVolume (http://wiki.garrysmod.com/page/IGModAudioChannel/SetVolume) only accepts a number between 0 and 1 it seems (check "soundchannel" under the wiki page for sound.PlayURL).
-
Cobalt actually suggested something about that earlier but I must have done something wrong because it didn't work at the time. So I just tried it again and it DOES work (changed it to 0.3). The bad news is that sometimes the music just stops and I get this error: BASS_StreamCreateURL error 40. Any thoughts?
-
Cobalt actually suggested something about that earlier but I must have done something wrong because it didn't work at the time. So I just tried it again and it DOES work (changed it to 0.3). The bad news is that sometimes the music just stops and I get this error: BASS_StreamCreateURL error 40. Any thoughts?
I found this post (http://facepunch.com/showthread.php?t=1285753&p=41328228&viewfull=1#post41328228), where he says that the error code comes from it timing out. I cannot verify this, but that's pretty much the only one I found that described the error. (There's also this link: http://www.bass.radio42.com/help/html/78effdb0-70b5-1602-a234-b0847b4e6d6c.htm (http://www.bass.radio42.com/help/html/78effdb0-70b5-1602-a234-b0847b4e6d6c.htm))
-
Well thanks so much for looking into it and I will ask Cobalt about that error. Can you tell me what you were referring to in your earlier post about BB code and how to post?
-
Well thanks so much for looking into it and I will ask Cobalt about that error. Can you tell me what you were referring to in your earlier post about BB code and how to post?
I sent you a PM explaining a bit about it.
-
[code]
blah
blah
[/code]
Would appear as
blah
blah
-
How would I go about moving the HUD from the top left of the screen to the top right of the screen showing current song playing?
Thanks so much!
-
Anyway you could add a system to this to allow clients to permanently opt out of hearing music?
Example:
!menu - Music - Do Not Play Sounds -Check
As apposed to a sound by sound bases, !stop, !stop , etc.
-
Anyway you could add a system to this to allow clients to permanently opt out of hearing music?
Example:
!menu - Music - Do Not Play Sounds -Check
As apposed to a sound by sound bases, !stop, !stop , etc.
I have stopped working on this for now as I have other things to do, but if you want to code this yourself it would be relatively easy.
-
Awesome addon! Works great! One question though, is there a way i can make it so it plays the music as soon as the round ends? Right now it has a few second delay before the music starts. Keep up the good work!
-
Awesome addon! Works great! One question though, is there a way i can make it so it plays the music as soon as the round ends? Right now it has a few second delay before the music starts. Keep up the good work!
that's likely your computer buffering the song
-
The music is so loud players are complaining. I tried adjusting the clipped mp3 on my website but the addon/server seems to adjust it back up. I tried to adjust your code as follows but I must be doing something wrong. Can you let me know how I can fix this? Thanks.
sound.PlayURL( url, "", function( station )
if station and IsValid( station ) then
station:Play()
station:SetVolume( 100 )
LocalPlayer().channel = station
end
end )
Did you ever figure out how to do this? I would like to lower the volume on my server too.
-
Did you ever figure out how to do this? I would like to lower the volume on my server too.
Read this:
The example showed on the wiki page of sound.PlayURL (http://wiki.garrysmod.com/page/sound/PlayURL) seems to be wrong.
SetVolume (http://wiki.garrysmod.com/page/IGModAudioChannel/SetVolume) only accepts a number between 0 and 1 it seems (check "soundchannel" under the wiki page for sound.PlayURL).
-
OK. I need help. I don't know Lua and no one really seems to well doctumte any of this online so whats wrong with:
elseif win == WIN_TIMELIMIT then
if LocalPlayer:IsUserGroup("NoMu") then
-- Do nothing
else
local toPlay = table.Random( timelimitsounds )
umsg.Start( "playurl", player.GetAll() )
umsg.String( toPlay[ 1 ] )
umsg.End()
umsg.Start( "SendSongName", player.GetAll() )
umsg.String( toPlay[ 2 ] )
umsg.End()
end
end
-
Not entirely sure what you're trying to accomplish here. Gonna need more info.
-
Not entirely sure what you're trying to accomplish here. Gonna need more info.
Well given I don't know enough about this language I was attempting to have the music not play if the user belonged to the group "NoMu".
I assumed I could add something like the above
EX:
if User.group = NoMu Then
-Don't Execute Music Script
Else
-Music Code
:/
Although if you can link me to a good site that explains Lua or how it works in GMod that might be helpful to. But I haven't found any.
-
if ply:IsUserGroup( "NoMu" ) then return end
-- rest of the code
-
And, hijacking a release thread to ask a question about code you're trying to modify isn't exactly best location.
I recommend Developer's corner, with a link to 'using <X> release, trying to do blah"
Too many releases here have 20 different parts of code in them, and few actually were done by the original authors.
Messy.
-
How would I go about moving the HUD from the top left of the screen to the top right of the screen showing current song playing?
Thanks so much!
Bumping this question. Thanks cobalt.
-
Read this:
I've been trying to get this to work as well, doesn't seem to want to.
Here's what I have in EndRoundMusic.lua, line 347 to 355.
sound.PlayURL( url, "", function( station )
if station and IsValid( station ) then
station:Play()
station.SetVolume(0.1)
LocalPlayer().channel = station
end
end )
end )
Even setting SetVolume to 0 doesn't seem to work. It just plays it at an extraordinarily loud volume - even if I lower it manually on Audacity.
Anyone have an idea as to what I'm doing wrong?
-
Oddly, I am using the exact same thing and it works for me. Did you find the answer?
-
Oddly, I am using the exact same thing and it works for me. Did you find the answer?
I'm afraid not, I had to open up all the audio files in Audacity and turn them down manually by a considerable amount!
It's weird that what I did doesn't work for some people though.
-
Also odd - the level in Audacity doesnt seem to have any effect on the clip I put on the server. What exactly did you change in Audacity to get it to work?? Many clips I have are still too loud so how did you adjust it in Audacity?
-
Awesome script Cobalt!
Just curious would there be a way to write the queued files to a file so they will be remembered on a map change? If not no biggie
Thanks Again!
-
Hey, thanks for the script. We tested it out on our server for a bit, but thought the sound level was too high. So we decided to customise the plugin so that you can change the volume of the sound being played with a command. Made mainly by Dekar, and a little bit by me Mrgreen.
As there seems to been more people with the problem, here is the modified version which adds a new command playvolume which allows you to change the volume of the sound being played. Also playurl now accepts a optional second argument, the volume of the sound, to be played.
If you want me to remove the download link, please just pm me.
For example:
"!playurl <url>" plays a sound with the volume set to 0.5.
"!playurl <url> 25" plays a sound with the volume set to 0.25.
"!playurl <url> 100" plays a sound with the volume set to 1. (max)
"!playvolume 100" changes the volume to 1 for the sound being played.
"!playvolume 10" changes the volume to 0.1 for the sound being played.
(edit: fixed bug)
-
How do the url links work? Can i copy over a link from youtube? Do i download a song and putt he path from my computer to the song? I'm really confused. Someone please explain what kind of link i must use. Also Only one song from the defaults work. The one linked fromt umblr. ALSO the play url thing doesnt workeither. Sorry for all the problems. Its an awesome idea but i cant seem tog et anything to work.
-
How do the url links work? Can i copy over a link from youtube? Do i download a song and putt he path from my computer to the song? I'm really confused. Someone please explain what kind of link i must use. Also Only one song from the defaults work. The one linked fromt umblr. ALSO the play url thing doesnt workeither. Sorry for all the problems. Its an awesome idea but i cant seem tog et anything to work.
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.
Has to be a http://blah/blah.mp3 (http://blah/blah.mp3) file link URL.
This is not a youtube player.
If you want to play mp3s on your computer and aren't running a http server, you have to store them in your gmod server and client /sound folder, and can use ulx playsound
-
Is there a way to make it so theres an option for players to permanently turn off music?
I also get this error
[ERROR] addons/ulx/lua/ulx/modules/sh/endroundmusic.lua:670: attempt to index local 'toAdd' (a nil value)
1. Function - addons/ulx/lua/ulx/modules/sh/endroundmusic.lua:670
2. unknown - lua/includes/modules/usermessage.lua:87
-
This would be great, and I am going to use it. Could you possibly add an option to disable this clientside for the odd person who doesn't like it? :P
-
The updated version is on my github: https://github.com/YVL-
-
This addon is awesome!
Can you fork off a generic version that can be used in any gamemode (by hooking round_start)? Also, can you add the option to make music play X seconds after round start?
-
Cobalt is this still on your github? I don't see it there, the updated version I mean.
-
Cobalt is this still on your github? I don't see it there, the updated version I mean.
https://github.com/YVL-/TTT-End-Round-Music
-
The updated version is on my github: https://github.com/YVL-/TTT-End-Round-Music
Made a pull request which will add the functionality to set an optional volume when playing sounds. It is basically the code I linked in a previous post of mine.
-
Sorry but this addon crashes players sometimes for some reason, some sort of buffer error :/
-
Sorry but this addon crashes players sometimes for some reason, some sort of buffer error :/
Sorry, but "some sort" is really no help to a developer who may not be able to replicate the issue.
Exact error would likely be more helpful to know if it's a Gmod error (due to a too big of a file/song or something), or if it's a code error he can adjust.
And, is it with certain songs? That would lead to more idea of if it's on Gmod vs code vs URL side.
IMO, GMod html functions (through Source HTML functions) have always been a bit flaky.
-
After installing it I am unable to open the ulx menu. Ulx is still works though. (I typed ulx help in the console)
As told, I added the .lua file to addons/lua/ulx/modules/sh, after opening the server the ulx menu wasnt able to open at all.
Cheers.
-
Your ULX Menu isn't opening because of a recent Garry's Mod update. You'll need to update your ULX and ULib. See here for details: http://forums.ulyssesmod.net/index.php/topic,8230.0.html (http://forums.ulyssesmod.net/index.php/topic,8230.0.html)
-
Is there a way to stop the end round music from playing outside the client?
As in which you switch out from the game to another window, the music still plays when it hits end round.
-
Is there a way to stop the end round music from playing outside the client?
As in which you switch out from the game to another window, the music still plays when it hits end round.
I think if you go to game settings/audio, theres an option for that, if that dosen't work then no theres not
-
This is a problem with anyone who joins the server. Whenever you leave the client, you can't hear what other people are saying or any game sounds, as it should be. However, for some reason, the end round music still plays loud and clear.
-
This is a problem with anyone who joins the server. Whenever you leave the client, you can't hear what other people are saying or any game sounds, as it should be. However, for some reason, the end round music still plays loud and clear.
Does anyone know a possible solution to my problem?
-
I realize that this is an old thread but I still use this script and frequently have this error come up:
[ERROR] addons/customcommands/lua/ulx/modules/sh/endroundmusic.lua:168: attempt to index local 'toPlay' (a nil value)
1. fn - addons/customcommands/lua/ulx/modules/sh/endroundmusic.lua:168
2. Call - addons/ulib/lua/ulib/shared/hook.lua:179
3. EndRound - gamemodes/terrortown/gamemode/init.lua:799
4. unknown - gamemodes/terrortown/gamemode/init.lua:321
Timer Failed! [winchecker][@gamemodes/terrortown/gamemode/init.lua (line 367)]
I lack the knowledge and experience to even know how to try to fix this and I'm wondering if anybody else has an idea of what might be needed to be done here to fix this. I really only use this script for the feature of queuing .mp3 links at the end of the TTT rounds but I haven't found any alternatives. Am I really the only person still using this?
-
So does this addon support sound clips you have on your server? There is only 1 alternative for this addon and the alternative has an author who provides no support and the addon can be faulty sometimes.
-
does this addon support sound clips you have on your server?
Only if you have a http/https web URL for 'your server'
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.
-
Do youtube urls work?
-
Do youtube urls work?
Has to be a http://blah/blah.mp3 (http://blah/blah.mp3) file link URL.
This is not a youtube player.
-
If I have any time soon, I'll clean up and release my End Round Music system. I'll add partial YouTube support for sure, and possibly full if I'm not lazy.
-
Did anyone get the F1 disable music thing to work? It's not working for me.
-
The F1 > disabling EOR music option isn't working for me -- does anyone know how to fix this?
(by the way this is for the updated EOR music version, found on his GitHub.)
-
Can you fix f1 menu bug please
-
Maybe version for Prop Hunt? I will be very happy :D
-
Here's a fix for F1 menu:
http://pastebin.com/BPwSTRVy
Copy and paste that on the similar code. DO NOT OVERWRITE THE MUSIC TEMPLATE WITH THIS. THE MUSIC TEMPLATE IS NOT INCLUDED.
-
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 (http://puu.sh/6gghR.jpg)
Menu: http://puu.sh/6ggna.jpg (http://puu.sh/6ggna.jpg)
Music tab: http://puu.sh/6ggnR.jpg (http://puu.sh/6ggnR.jpg)
Queuing a song:
Step 1: http://puu.sh/6ggt1.bmp (http://puu.sh/6ggt1.bmp)
Step 2: http://puu.sh/6gguz.bmp (http://puu.sh/6gguz.bmp)
Done: http://puu.sh/6ggxy.bmp (http://puu.sh/6ggxy.bmp)
Queue: http://puu.sh/6ggAe.bmp (http://puu.sh/6ggAe.bmp)
Cooldown: http://puu.sh/6ggMC.jpg (http://puu.sh/6ggMC.jpg)
+
After the round i did not hear and my friends did not hear anything too ???
-
After the round i did not hear and my friends did not hear anything too ???
Can you provide a few mp3 URL(s) you tried in the queue?