AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Dispenser Music (v0.4.1, 2014-05-02) (https://forums.alliedmods.net/showthread.php?t=219800)

redjazz96 07-02-2013 21:51

[TF2] Dispenser Music (v0.4.1, 2014-05-02)
 
2 Attachment(s)
Adds music to any dispensers built.

Features
  • 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!

CVARs/Commands
Spoiler


Changelog

Code:

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.

Install
  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:
    Spoiler

    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

Plans
  • 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!

7106 07-03-2013 08:22

Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
 
i dont know why it doesnt work...

Rads 07-03-2013 09:30

Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
 
So what error you getting .? helps to have a bit more info,

captaindeterprimary 07-03-2013 14:15

Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
 
1) http://legacy.vman315.com/backup/111...spidieneat.jpg

2)
Quote:

Originally Posted by redjazz96 (Post 1982288)
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.

3)
Quote:

Originally Posted by redjazz96 (Post 1982288)
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?

4)
Quote:

Originally Posted by redjazz96 (Post 1982288)
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.

redjazz96 07-03-2013 18:54

Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
 
Quote:

Originally Posted by vman315 (Post 1982672)

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.

redjazz96 07-03-2013 18:59

Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
 
Quote:

Originally Posted by 7106 (Post 1982487)
i dont know why it doesnt work...

Did you set it up right, i.e. set the values of the CVARs correctly?

Bitl 07-07-2013 19:21

Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
 
Quote:

L 07/07/2013 - 14:47:29: [SM] Native "ReadDirEntry" reported: Invalid file handle 0 (error 4)
L 07/07/2013 - 14:47:30: [SM] Displaying call stack trace for plugin "dispenser_music.smx":
L 07/07/2013 - 14:47:30: [SM] [0] Line 70, /home/groups/alliedmodders/forums/files/2/3/2/5/1/8/122075.attach::SetupSounds()
L 07/07/2013 - 14:47:30: [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:

Quote:

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

Quote:

sm_dispenser_music_server_directory "sound/music/mvm/"
sm_dispenser_music_directory "music/mvm/"

Maddux 07-07-2013 20:39

Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
 
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!

redjazz96 07-07-2013 21:13

Re: [TF2] Dispenser Music (v0.1.1, 2013-06-02)
 
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 07-09-2013 22:23

Re: [TF2] Dispenser Music (v0.2.0, 2013-06-09)
 
Updated.


All times are GMT -4. The time now is 03:33.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.