Raised This Month: $13 Target: $400

[TF2] Dispenser Music (v0.4.1, 2014-05-02)

Post New Thread Reply   
Thread Tools Display Modes
Junior Member
Join Date: Jul 2013
Plugin ID:
Plugin Version:
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    Plugin Description:
    Adds musics to dispensers.
    Old 07-02-2013 , 21:51   [TF2] Dispenser Music (v0.4.1, 2014-05-02)
    Reply With Quote #1

    Adds music to any dispensers built.

    • Handles hooking music events to dispenser entities
    • Picks a song by random
    • Figures out song time
    • Plays songs
    • !dispenser command for players to determine if they want their dispenser to play music

    This plugin requires the Sound Info Library!



    2014-05-02 (v0.4.1)
    * Adds !dispenser command
    * Allows songs to be put on rotation
    2014-04-22 (v0.3.0)
    * Cleans up the configuration file
    * Music plays on dispenser creation
    * Removes limit on number of sounds
    2013-06-09 (v0.2.0)
    * Adds a configuration file in sourcemod/configs/dispenser_music.cfg to list music
    * Binds the music to the location of the dispenser
    2013-06-02 (v0.1.1)
    * Removes debug calls.
    * Moves callback from OnMapStart to OnConfigsExecuted
    * Removes load on plugin start
    2013-06-02 (v0.1.0)
    * Initial release.
    1. Place the .smx file in the plugins folder.
    2. Create a file called dispenser_music.cfg in sourcemod/configs.
    3. Fill it with your songs. Example:

      Each entry (the key for the entry doesn't matter) must contain a "file" key, which points to the file relative to the sound directory (in the tf folder).
    4. If you want the plugin to play other sounds when the current one finishes, you must place the sounds in the server's sound directory
    5. Run sm plugins load dispenser_music

    • Allow volume to be set for the songs.
    • Remove the limit on the number of songs the plugin can handle. (done!)
    • Make specifying sound directories easier. This is gonna be done by adding a configuration file to the server so sounds can be specified. (done!)

    New video (Old video)

    Is my first plugin!
    Attached Files
    File Type: sp Get Plugin or Get Source (dispenser_music.sp - 513 views - 7.3 KB)
    File Type: smx dispenser_music.smx (8.5 KB, 871 views)

    Last edited by redjazz96; 05-04-2014 at 13:46. Reason: update to 0.4.1
    redjazz96 is offline
    Senior Member
    Join Date: Jun 2013
    Old 07-03-2013 , 08:22   Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
    Reply With Quote #2

    i dont know why it doesnt work...
    7106 is offline
    AlliedModders Donor
    Join Date: Feb 2008
    Location: Achievement what
    Old 07-03-2013 , 09:30   Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
    Reply With Quote #3

    So what error you getting .? helps to have a bit more info,
    4UHost.UK - Premium Hosting Solution
    -- -- -- -- -- -- -- -- -- -- -- -- -----------
    Rads is offline
    AlliedModders Donor
    Join Date: Sep 2012
    Old 07-03-2013 , 14:15   Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
    Reply With Quote #4


    Originally Posted by redjazz96 View Post
    sm_dispenser_music_server_directory the directory all of the songs are on the server. This is normally in sound/dispenser on your FastDL server; it looks through this directory for songs, and adds them to a list. There is a max of 100 songs so far, and this path is relative to addons/sourcemod (or whereever your sourcemod path is).
    So you (add the dir then) store the sounds on the server in /addons/sourcemod/sounds/ or what because that's what that sounds like, and that sounds like a bad idea. Clearly a CVAR.

    Originally Posted by redjazz96 View Post
    sm_dispenser_music_directory the path all of the songs are, relative to the sound directory.
    Relative to what dir? The inane /tf/addons/sourcemod/sounds/ or the usual /tf/sounds/. CVAR?

    Originally Posted by redjazz96 View Post
    sm_dispenser_music_reload reloads all of the songs, adding them to the download list and precaching them. Automatically ran on map start and on plugin load. Note: if you add more songs, it may require a map change to cache the sounds - i'm not sure.
    It would require a map change because clients would not have said sound/s downloaded. Clearly a command.

    5) Does it play the sound to the builder only or to the whole server, there needs to be a command so players can choose the sounds.

    6) I can see earrape ensuing due to the fact that there is no radius for other dispensers, and its not playing to client but to all players.

    7) Pretty much this.
    Last edited by ; Today at 08:20 AM. Reason: Get rid of s

    Last edited by captaindeterprimary; 04-27-2014 at 16:11.
    captaindeterprimary is offline
    Junior Member
    Join Date: Jul 2013
    Old 07-03-2013 , 18:54   Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
    Reply With Quote #5

    Originally Posted by vman315 View Post
    1) Thanks!

    2) Yes, it's a CVAR. One of the problems I have with this plugin is that it's not easy to add new sounds. In a server I have set up to test this, all of my fastDL files are served from ~/public, and the addons folder for sourcemod is in ~/steamcmd/tf/tf/addons/sourcemod. I placed the music for the dispensers in ~/public/sound/dispenser, so the value of this cvar was "../../../../../public/sounds/dispenser/". The sound folder's not in addons/sourcemod, but it can be if you set it to that. I really want to modify this so that it's easier to use, but I have no idea on how to do this. Suggestions?

    3) Yes, it's a CVAR, and it's relative to the usual tf/sounds. This is mainly for the client, so that it downloads the sound file, and so that it plays the sound files.

    4) This is true, but I wrote that with the understanding that they did have the sound downloaded, which is usually not the case. You are right, then, in the normal case, but in the case that I said, it would also require a server map change (I think) in order to precache the sounds.

    5) To the whole server, and I did think about adding a command to choose the sounds. I might implement that, and it defaults to a random sound.

    6) In the game, it's not that loud, but if you have a suggestion on how to fix that, let me know. If you watched the video, though, you'll note that the sound is attached to the dispenser, and as you move away from it, the sound diminishes.

    7) Somewhat, but more generalized for everyone's use.

    Last edited by redjazz96; 07-03-2013 at 18:58. Reason: talk about comparative adverbs
    redjazz96 is offline
    Junior Member
    Join Date: Jul 2013
    Old 07-03-2013 , 18:59   Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
    Reply With Quote #6

    Originally Posted by 7106 View Post
    i dont know why it doesnt work...
    Did you set it up right, i.e. set the values of the CVARs correctly?
    redjazz96 is offline
    Senior Member
    Join Date: Jul 2012
    Old 07-07-2013 , 19:21   Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
    Reply With Quote #7

    L 07/07/2013 - 14:47:29: [SM] Native "ReadDirEntry" reported: Invalid file handle 0 (error 4)
    L 07/07/2013 - 14:470: [SM] Displaying call stack trace for plugin "dispenser_music.smx":
    L 07/07/2013 - 14:470: [SM] [0] Line 70, /home/groups/alliedmodders/forums/files/2/3/2/5/1/8/122075.attach::SetupSounds()
    L 07/07/2013 - 14:470: [SM] [1] Line 43, /home/groups/alliedmodders/forums/files/2/3/2/5/1/8/122075.attach::OnConfigsExecuted()
    Here's my server.cfg setup OLD:

    sm_dispenser_music_server_directory sound/music/mvm/
    sm_dispenser_music_directory music/mvm/
    Here's my latest one:

    sm_dispenser_music_server_directory "sound/music/mvm/"
    sm_dispenser_music_directory "music/mvm/"
    My Plugins
    Modified Plugins:
    Building Spawner
    It's Raining Men!
    Custom Gamemode

    Bitl is offline
    New Member
    Join Date: Jul 2013
    Old 07-07-2013 , 20:39   Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
    Reply With Quote #8

    Hey there, i believe i have your plugin installed correctly, but still to no avail. I added you on steam to see if i could lend a hand. I'm not getting any errors or anything, its just not working. The plugin sounds really awesome and would love to use it. So when you get a chance can you accept me on steam? Thank you!
    Maddux is offline
    Junior Member
    Join Date: Jul 2013
    Old 07-07-2013 , 21:13   Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
    Reply With Quote #9

    So, what I'm gonna do is I'm gonna place a configuration file on the server for you to configure so you can list the files you want the plugin to use.

    Bitl, your problem is that the directory sound/music/mvm doesn't exist in tf/addons/sourcemod; I made the path relative to the sourcemod directory, because I was having problems otherwise. But I'm gonna change that.
    redjazz96 is offline
    Junior Member
    Join Date: Jul 2013
    Old 07-09-2013 , 22:23   Re: [TF2] Dispenser Music (v0.2.0, 2013-06-09)
    Reply With Quote #10

    redjazz96 is offline

    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump

    All times are GMT -4. The time now is 01:45.

    Powered by vBulletin®
    Copyright ©2000 - 2020, vBulletin Solutions, Inc.
    Theme made by Freecode