This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[REQ] Ambient music


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
deejay87
Senior Member
Join Date: Apr 2004
Location: Pays du Glaude - France
Old 12-30-2009 , 12:33   [REQ] Ambient music
Reply With Quote #1

hi

Someone can code a simple but usefull plugin for play a music ambient :
- Start on map start or round start (cvar?)
- Loop (choice of time of the song to loop)
- (optionnal) volume
- For all games of sourcemod work (Dod - tf2 - css .. )

Usefull for fun server like Zombiemod , Starwars, Deathmatch

The only one i have seen it's jukebox but it's a biggest plugin just for do this

Edit : I have try jukebox to seem's work like i need (server Dods) , the only problem is no song play directly at spawn

Thanks
__________________

Last edited by deejay87; 01-01-2010 at 21:20.
deejay87 is offline
Send a message via MSN to deejay87 Send a message via Skype™ to deejay87
anonpiss
Senior Member
Join Date: Jan 2010
Old 01-17-2010 , 21:49   Re: [REQ] Ambient music
Reply With Quote #2

Such plugin would be useful but unfortunately there is none in SM yet.
anonpiss is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 01-18-2010 , 05:09   Re: [REQ] Ambient music
Reply With Quote #3

There is exactly that in Zombie:Reloaded if you need it for a zombiemod.


But outside of that, someone can port that code into a separate plugin. Just credit the authors (me and rhelgeby). It's in the soundeffects module, ambientsounds.inc
__________________
Greyscale is offline
deejay87
Senior Member
Join Date: Apr 2004
Location: Pays du Glaude - France
Old 01-18-2010 , 11:34   Re: [REQ] Ambient music
Reply With Quote #4

Thanks for explain that, it's true it can be usefull for some's admins, i have try "jukebox" but the song don't play when player spawn (dod:s)

I'm waiting to see if someone can made something ;)
__________________
deejay87 is offline
Send a message via MSN to deejay87 Send a message via Skype™ to deejay87
theY4Kman
Join Date: Jun 2007
Location: Yak
Old 01-19-2010 , 04:01   Re: [REQ] Ambient music
Reply With Quote #5

Alright, I've made the plug-in for ya. Can't say I've tested it, but it should work All credit goes to Greyscale and rhelgeby. btw, I've included zr_ambience.mp3 in the zip -- is that okay with you, Greyscale?

It has four cvars:
  • sm_ambience (0/1) - Turn ambience on or off
  • sm_ambience_file (ambient/zr/zr_ambience.mp3) - Path to ambient sound file that will be played throughout the game, when sm_ambience is 1
  • sm_ambience_length (60.0) - The length, in seconds, of the ambient sound file
  • sm_ambience_volume (0.6) - Volume of ambient sounds when sm_ambience is 1 (0.0: Unhearable, 1.0: Max volume)
Attached Files
File Type: zip ambientsounds.zip (942.1 KB, 267 views)
File Type: sp Get Plugin or Get Source (ambience.sp - 731 views - 3.9 KB)
__________________
http://y4kstudios.com
Is that loud enough? Oh, while I have you, check out Viper.

Last edited by theY4Kman; 01-19-2010 at 05:32. Reason: Alright, now it's fixed
theY4Kman is offline
Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
anonpiss
Senior Member
Join Date: Jan 2010
Old 01-19-2010 , 05:20   Re: [REQ] Ambient music
Reply With Quote #6

good one. should have just found this one earlier.

Last edited by anonpiss; 01-19-2010 at 06:12.
anonpiss is offline
Xada
Junior Member
Join Date: May 2017
Old 03-16-2021 , 19:37   Re: [REQ] Ambient music
Reply With Quote #7

Quote:
Originally Posted by theY4Kman View Post
Alright, I've made the plug-in for ya. Can't say I've tested it, but it should work All credit goes to Greyscale and rhelgeby. btw, I've included zr_ambience.mp3 in the zip -- is that okay with you, Greyscale?

...
Pardon the (admittedly big) necro here, though I felt posting here would do more good than making a duplicate thread requesting the same exact thing.

Y4k's plugin here appears to have the exact functionality I am looking for, though it doesn't seem to work anymore. Would anybody be willing to update it or make a new plugin with similar functionality-- specifically for L4D2?

L4D2's music system is finicky to be sure but the sm_play command works fine for playing everything from WAVs to MP3s so I know something like this must be possible. Maybe hooking the sm_play functionality and repeating on sound end, or perhaps looping based on a second-based interval like Y4K's plugin?

A per-map CFG music-file path would be desirable as well (changeable song cvar perhaps?), effectively making per-map theme-songs that would loop indefinitely (similar to oldschool FPS games this way, ie. Unreal,Quake).
Xada is offline
amauri_long
Member
Join Date: Sep 2014
Location: USA Moon Base
Old 06-29-2023 , 19:10   Re: [REQ] Ambient music Solved I need help to remove warnings when compiling
Reply With Quote #8

Solved I need help to remove warnings when compiling

warning 234: symbol "GetMaxClients" is marked as deprecated: Use MaxClients variable



new maxplayers = MaxClients;// UPDATE CRACH SEVER
for (new x = 1; x <= maxplayers; x++)
{
if (!IsClientInGame(x))

config

sm_ambience 1
sm_ambience_file "ambient/zr/zombie_ambience.mp3"
sm_ambience_length "285‬.9"
sm_ambience_volume "0.9"
Attached Files
File Type: sp Get Plugin or Get Source (ambience.sp - 86 views - 4.0 KB)
File Type: zip sound.zip (8.25 MB, 47 views)

Last edited by amauri_long; 06-29-2023 at 19:18. Reason: Update 29-06-2023
amauri_long is offline
Reply



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 10:53.


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