Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Steam \ SteamApps \ common \ Half-Life 2 \ hl2
Rename this folder to "custom"
Create a new folder inside and give it a descriptive name (example: turret_sounds).
All the files inside this folder are used instead of the original ones when the game is booted up, so this is where you should place your new files, but you have to follow the same structure used by the game.
Example:
If you're replacing the model of the crowbar, the folder structure should look like this:
custom / new_crowbar / models / weapons / <model files>
If you are replacing the textures of the crowbar, the structure should be this:
custom / new_crowbar / materials / models / weapons / v_crowbar / <texture files>
Given that you're replacing sound files, the structure should be something like this:
custom / turret_sounds / sound / ar1 / <sound files>
Your files must have the same name of the original files, otherwise the game won't use them.
Now you only have to open the game.
You say that my files must use the same names, but that's where the problem lies.
The turrest uses only one sound file for its firing sound. I can replace that file with my own custom sound easily enough and have it working, but I'd like to have the script draw from a pool of sounds.
In the script I posted above, every time the gun fires a bullet it will randomly select one of the four sounds listed and use that as the firing sound. I prefer this to using just the one sound as it results in much more dynamic, less repetitive audio.
However, as the turret only uses the one firing sound, I can't use the original file names because there aren't enough files there originally for me to use my four custom sounds.
The script I posted above would work if there was a way I could add my custom sounds to the sound cache.
In Left 4 Dead 2 you can add custom sound files (with custom names) to the sound cache with the snd_rebuildaudiocache command, and that allows the script technique I posted above to work without issues. However, there doesn't seem to be any console command to add sounds to the cache in Half-Life 2.
What I'm trying to figure out here is how to add custom files to the sound cache.
What's really odd is that I'm using multiple sound files and the script technique above for the Pistol, SMG, and AR2, and they're all working fine. I'm not sure what exactly happened to make them work but not the turret though.
My main work with Source is model/texture replacement, so I can't really help much in this area. However, I've noticed that when a vpk file is placed in the "custom" folder, after you run the game, a sound cache is created for that file.
Like in this image.[k42.kn3.net]
You don't even have to pack them as vpk, just put your files in the "custom" folder following the right structure and keeping your original names, when you start the game a cache file should be created in this folder: custom / my_new_sounds / Sound
Like in this image.[k45.kn3.net]
I hope this is useful for you.
________________________________________
In any case, you might find this intresting/helpful.
Soundcache - VDC
Precaching Assets - VDC
PrecacheScriptSound - VDC
However, upon further investigation I found that I could get my custom sounds working if I used them for the AR2 instead.
I'm using some custom models I downloaded for the AR2, Pistol, and SMG, so that could have something to do with the fact that my custom sounds are working for those weapons but not the turret.
Perhaps something goes in the .qc file for these weapons that enables the use of custom sounds rather than just the default ones?