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

0 Members and 3 Guests are viewing this topic.

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: TTT Advanced End Round Music
« Reply #30 on: January 30, 2014, 05:02:56 PM »
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.

Offline loserman778

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: TTT Advanced End Round Music
« Reply #31 on: February 04, 2014, 01:52:36 PM »
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!

Offline pants

  • Newbie
  • *
  • Posts: 33
  • Karma: 4
Re: TTT Advanced End Round Music
« Reply #32 on: February 04, 2014, 02:31:55 PM »
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

Offline loserman778

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: TTT Advanced End Round Music
« Reply #33 on: February 05, 2014, 07:09:05 AM »
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.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: TTT Advanced End Round Music
« Reply #34 on: February 05, 2014, 07:33:34 AM »
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 seems to be wrong.
SetVolume only accepts a number between 0 and 1 it seems (check "soundchannel" under the wiki page for sound.PlayURL).
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline goodman854

  • Newbie
  • *
  • Posts: 14
  • Karma: 2
Re: TTT Advanced End Round Music
« Reply #35 on: February 06, 2014, 09:46:16 AM »
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:

Code: [Select]
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

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: TTT Advanced End Round Music
« Reply #36 on: February 06, 2014, 01:00:33 PM »
Not entirely sure what you're trying to accomplish here. Gonna need more info.

Offline goodman854

  • Newbie
  • *
  • Posts: 14
  • Karma: 2
Re: TTT Advanced End Round Music
« Reply #37 on: February 06, 2014, 02:11:23 PM »
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.

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: TTT Advanced End Round Music
« Reply #38 on: February 06, 2014, 05:16:07 PM »
if ply:IsUserGroup( "NoMu" ) then return end

-- rest of the code
« Last Edit: February 06, 2014, 05:18:22 PM by Cobalt »

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 #39 on: February 06, 2014, 07:33:13 PM »
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.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline n00bl3t

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
Re: TTT Advanced End Round Music
« Reply #40 on: February 20, 2014, 03:15:10 PM »
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.

Offline Setix

  • Newbie
  • *
  • Posts: 3
  • Karma: 1
Re: TTT Advanced End Round Music
« Reply #41 on: February 21, 2014, 03:18:20 AM »
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.

Code: [Select]
        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?

Offline Storm

  • Full Member
  • ***
  • Posts: 220
  • Karma: 4
Re: TTT Advanced End Round Music
« Reply #42 on: March 05, 2014, 07:40:23 AM »
Oddly, I am using the exact same thing and it works for me. Did you find the answer?

Offline Setix

  • Newbie
  • *
  • Posts: 3
  • Karma: 1
Re: TTT Advanced End Round Music
« Reply #43 on: March 07, 2014, 01:52:51 PM »
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.

Offline Storm

  • Full Member
  • ***
  • Posts: 220
  • Karma: 4
Re: TTT Advanced End Round Music
« Reply #44 on: March 08, 2014, 12:24:52 PM »
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?