Raised This Month: $32 Target: $400
 8% 

Sound replacements V. 1.2


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Gameplay        Approver:   Brad (55)
Silencer123
Veteran Member
Join Date: Jul 2006
Old 06-01-2009 , 19:26   Sound replacements V. 1.2
Reply With Quote #1

Sound replacements

This is a simple plugin for replacing networked sounds.
It won't work for client side sound effects.

By default, have an sr.cfg in addons/amxmodx/configs,
in which every line covers the path to the sound file to
replace, then a space, and then the path to the sound
file to use as replacement.

Example:
Code:
weapons/cbar_hit1.wav weapons/explode3.wav
Supported modifications are all, except Sven Co-op 3.0
and 4.0, because they have too massive changes to HL's
sound engine.

This also automatically prevents the replaced sounds from precaching.
The support feature for modifications with an altered HL sound engine
or a completely different sound engine has been designed for Sven
Co-op, but ultimately fails its purpose in that mod. Maybe it works for
other modifications I don't know of yet.


Version history:
  • V. 1.2:
    • More optimizations.
    • More security checks.
    • More flexibility with the replacement file.
  • V. 1.1:
    • Some optimization for faster code.
  • V. 1.0:
    • Initial release.


Thanks to...
joaquimandrade ,
ConnorMcLeod ,
arkshine and
fysiks
...for some and much help on the way.


Enjoy.
Attached Files
File Type: cfg sr.cfg (1.1 KB, 2318 views)
File Type: sma Get Plugin or Get Source (sr.sma - 4220 views - 6.8 KB)
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 06-05-2009 at 14:21. Reason: Updated
Silencer123 is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-01-2009 , 19:52   Re: Sound replacements
Reply With Quote #2

Thanks for remembering me in the thanks list

For further improve your plugin, you can switch to dynamic arrays that make you able to do not force constraints on the size of the list of sounds to replace and use tries to speed up the string search on your sound forwards.

Hugs.
__________________
joaquimandrade is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-02-2009 , 01:00   Re: Sound replacements
Reply With Quote #3

I think it does the same thing as this http://forums.alliedmods.net/showthread.php?p=514507
Am i wrong ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 06-02-2009 , 07:16   Re: Sound replacements
Reply With Quote #4

Oh, yes for the sound part. It also has some more optimization I see. Did not find it because I searched for sound replacement in the plugins list. They really need tags. Just searching by thread title is a bit insufficient imho.

@ joaquimandrade : I wanted to make it dynamic, but it "must be a constant expression".
Appears dynamic arrays are only possible within a function in small for whatever reason.
That plugin Connor mentioned uses a special module "vdf" which handles this.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Old 06-02-2009, 07:33
Rirre
This message has been deleted by Rirre.
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-02-2009 , 08:50   Re: Sound replacements
Reply With Quote #6

Dynamic arrays are not the pawn normal arrays. Check the file "cellarray.inc" in your amxmodx installation, in the include folder.
__________________
joaquimandrade is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 06-02-2009 , 09:56   Re: Sound replacements V. 1.1
Reply With Quote #7

Oh I see. It says they are slower, though. :p
Well, this plugin works and that shall be sufficient.
For anyone who wants more funcitonality there is the Content replacement plugin.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-02-2009 , 10:29   Re: Sound replacements V. 1.1
Reply With Quote #8

Quote:
It won't work for client side sound effects.
So it can't replace weapon shot sounds?

And explode3.wav it is server side ? lol
xbatista is offline
Send a message via Skype™ to xbatista
Silencer123
Veteran Member
Join Date: Jul 2006
Old 06-02-2009 , 15:28   Re: Sound replacements V. 1.1
Reply With Quote #9

weapons/explode3.wav is the new sound. Of course you can use sounds from sound effects which are client side as replacement, but not vice versa. You grab the common sense?
__________________
EAT YOUR VEGGIES
Silencer123 is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-02-2009 , 15:34   Re: Sound replacements V. 1.1
Reply With Quote #10

yes :]
xbatista is offline
Send a message via Skype™ to xbatista
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 11:31.


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