Raised This Month: $51 Target: $400
 12% 

Content Replacer


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Gameplay        Approver:   Hawk552 (427)
ts2do
Senior Member
Join Date: Mar 2004
Old 08-08-2007 , 13:28   Content Replacer
Reply With Quote #1

About
With this plugin you can replace content in the game with custom content. You can swap any two resources with each other without risking any complications. The plugin precaches any new resources being used.
Usage
Code:
"ContentReplace"
{
	"Models"
	{
		<Entries here would apply to all maps>
		"de_dust;cs_office"
		{
			<Entries here would only apply to de_dust and cs_office>
		}
		"!de_dust;cs_office"
		{
			<Entries here would only apply to maps other than de_dust and cs_office>
		}
	}
	"Sounds"
	{
		<The following replaces in this fashion: hos1->vehicle1, hos2->vehicle2, etc...>
		"hostage/hos(.*).wav" "plats/vehicle(1).wav"
		<The following switches affirmative and negative>
		"!MRAD_AFFIRM" "!MRAD_NEGATIVE"
		"!MRAD_NEGATIVE" "!MRAD_AFFIRM"
	}
}
  • Include models/ in Models entries.
  • Don't include sound/ in Sounds entries.
  • When replacing a sound, check whether or not it's played as a sentence in sound/senteces.txt.
  • Wherever you want a true wildcard in a left-side file, use (.*).
  • To match all models in a specific folder (e.g. no subdirectories), use ([^/]*).
  • When you need to copy over a matched substring [e.g. what matched inside (.*)], use (#). To have the literal text (1) in the replacement, simply use (\1\)
Can Replace
  • All models
  • All sprites
  • Some sounds
Can't Replace
  • Footstep sounds
  • Some weapon sounds
Notes
  • You must have the Vdf module installed on the server.
  • Texture models should not explicitly be replaced (e.g. *t.mdl).
  • Sprites should be added to the Models branch.
  • Always remember that introducing new content requires users to download that content and may cause a long download time.
Version 1.0
  • Initial release
Version 1.1
  • Added sentence support
Version 1.2
  • Map-specific configuration
  • Sprite support
Version 1.3
  • Regex
  • Vdf utilization
Version 1.4
  • Precache *t models
  • Cellarray utilization (in the latest build of AMX Mod X)
    Note that the online compiler does not support 1.80, so the plugin has been compiled and compressed into the attached contentreplace.zip.
Attached Files
File Type: sma Get Plugin or Get Source (contentreplace.sma - 4312 views - 13.9 KB)
File Type: zip contentreplace.zip (14.4 KB, 2816 views)

Last edited by ts2do; 08-30-2007 at 22:45.
ts2do is offline
Send a message via AIM to ts2do
ColdPro
Senior Member
Join Date: Jul 2007
Location: At your back! Killing yo
Old 08-08-2007 , 13:54   Re: Content Replacer
Reply With Quote #2

That looks cool GJ
__________________

ColdPro is offline
Send a message via AIM to ColdPro
BlackMilk
Veteran Member
Join Date: Jun 2007
Old 08-09-2007 , 13:35   Re: Content Replacer
Reply With Quote #3

For example if I want the change the sound of (blahhh/blahhhh maps) the "baby demon"'s scream I can use this plugin to replace it with a sound file of my own?
__________________
Mod:
User:
BlackMilk is offline
ts2do
Senior Member
Join Date: Mar 2004
Old 08-09-2007 , 16:30   Re: Content Replacer
Reply With Quote #4

yes...but it will replace it on all maps, not only those...
I can add that feature if anyone wants it
__________________
ts2do is offline
Send a message via AIM to ts2do
BlackMilk
Veteran Member
Join Date: Jun 2007
Old 08-09-2007 , 16:47   Re: Content Replacer
Reply With Quote #5

Right now I can't think of anything I'd like to replace, but I'm almost 100% sure that going through the hundreds of maps I have I'll find some things I'll want to change =]
__________________
Mod:
User:
BlackMilk is offline
ts2do
Senior Member
Join Date: Mar 2004
Old 08-09-2007 , 18:00   Re: Content Replacer
Reply With Quote #6

I want to pass this by you guys to see what you think:
For wildcards, you can use : to match files within subdirectories also and * to match only one directory...
Examples:
models/*.mdl will not match models/alpha/beta.mdl
models/alpha*/gamma.mdl will match models/alphabeta/gamma.mdl
models/:.mdl will match models/alpha/beta.mdl

For further replacement depth, you could also have models/v_*.mdl to replace view models. For the replacement, you could use models/replacement/v_*.mdl to insert the original matched text back in. I would make this on an if-exist basis, so the server would check if a replacement for a certain model exists and if not, will not replace it.
__________________
ts2do is offline
Send a message via AIM to ts2do
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-10-2007 , 03:16   Re: Content Replacer
Reply With Quote #7

Please add per-maps config files( for black milk example ) and also prefix config files (for example to change hostages sounds only on cs_ maps) and it would be perfect.

This doesn't work :
Code:
"sound/weapons/usp_unsil-1.wav" "sound/weapons/usp1.wav"

Last edited by ConnorMcLeod; 08-10-2007 at 06:15.
ConnorMcLeod is offline
ts2do
Senior Member
Join Date: Mar 2004
Old 08-10-2007 , 07:15   Re: Content Replacer
Reply With Quote #8

Prefix configs actually don't sound too useful...since the replacements can remain in the config without being used.
Try to remove the quotes
__________________
ts2do is offline
Send a message via AIM to ts2do
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-10-2007 , 07:37   Re: Content Replacer
Reply With Quote #9

Doesn't work.
I think that weapon sounds don't call your plugin forwards.

I tried with another sound without succes :
Code:
"sound/radio/ct_fireinhole.wav" "sound/vox/_period.wav"
sound/radio/ct_fireinhole.wav sound/vox/_period.wav
"radio/ct_fireinhole.wav" "vox/_period.wav"
radio/ct_fireinhole.wav vox/_period.wav
"sound/radio/ct_fireinhole" "sound/vox/_period"
sound/radio/ct_fireinhole sound/vox/_period
"radio/ct_fireinhole" "vox/_period"
radio/ct_fireinhole vox/_period
Plugin is running, config file is where it has to be.


I didn't test with file like knife sound, or rain sound cause i'm sure sure it works.
ConnorMcLeod is offline
ts2do
Senior Member
Join Date: Mar 2004
Old 08-10-2007 , 09:18   Re: Content Replacer
Reply With Quote #10

The latest version should be more stable. Plus I've provided examples.
__________________

Last edited by ts2do; 08-10-2007 at 22:24.
ts2do is offline
Send a message via AIM to ts2do
Old 08-12-2007, 00:50
ts2do
This message has been deleted by ts2do.
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 06:16.


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