AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Content Replacer (https://forums.alliedmods.net/showthread.php?t=59125)

ts2do 08-08-2007 13:28

Content Replacer
 
18 Attachment(s)
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.

ColdPro 08-08-2007 13:54

Re: Content Replacer
 
That looks cool GJ :up:

BlackMilk 08-09-2007 13:35

Re: Content Replacer
 
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?

ts2do 08-09-2007 16:30

Re: Content Replacer
 
yes...but it will replace it on all maps, not only those...
I can add that feature if anyone wants it

BlackMilk 08-09-2007 16:47

Re: Content Replacer
 
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 =]

ts2do 08-09-2007 18:00

Re: Content Replacer
 
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.

ConnorMcLeod 08-10-2007 03:16

Re: Content Replacer
 
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"

ts2do 08-10-2007 07:15

Re: Content Replacer
 
Prefix configs actually don't sound too useful...since the replacements can remain in the config without being used.
Try to remove the quotes

ConnorMcLeod 08-10-2007 07:37

Re: Content Replacer
 
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.

ts2do 08-10-2007 09:18

Re: Content Replacer
 
The latest version should be more stable. Plus I've provided examples.


All times are GMT -4. The time now is 21:16.

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