Left 4 Dead 2

Left 4 Dead 2

Not enough ratings
How to fix/create a VPK add-on
By XCT3
There are a lot of broken audio add-ons in the Workshop. This is an easy 10-step guide to fixing those and adapting them as your own.
   
Award
Favorite
Favorited
Unfavorite
Modding an existing add-on
There are a lot of broken audio add-ons in the Workshop. For example: Santa Christ Theme Song Tank Music

To fix that add-on:

1. Use GCFScape[nemesis.thewavelength.net] to extract the root folder of the vpk file.
2. Rename the root folder to "SantaChristTankTheme".
3. Create a folder in there named "sound".
4. Move the music folder into the sound folder. Dragging it should work.
5. Go into SantaChristTankTheme/sound/music/tank
6. Use Audacity[audacity.sourceforge.net] to export the .wmv files to PCM .wav files.
7. Delete the wmv files.
8. Drag the SantaChristTankTheme folder onto (a shortcut to) "C:\Program Files (x86)\Steam\steamapps\common\left 4 dead 2\bin\vpk.exe" to create a working vpk file.
9. Put the new vpk file into "C:\Program Files (x86)\Steam\steamapps\common\left 4 dead 2\left4dead2\addons"
10. Start the game and make sure your add-on is enabled before any conflicting ones to make sure its changes aren't overridden. Test whether the volume of the custom sounds is high enough and that all textures are working. (Make it easy: Enable the development console in the options, toggle it with the ` key, and enter "sv_cheats 1; god 1; map <mapname>". "maps *" will show you a list of maps.)

To create your own mod, use one as a template and replace/delete the files. For non-workshop mods, you should add addonimage.jpg (128x128 pixels) next to addoninfo.txt

I've tested these steps on 64-bit Windows 7. File locations may vary. On other systems, Wine[www.winehq.org] might help, or open a terminal to run vpk <vpkfile> (That will create a folder next to the vpk file.) and ffmpeg[www.ffmpeg.org] or somesuch.
Adding sounds
According to the fun but buggy Wand Massacre addon, sound files are assigned per level, e.g. chapter 10 mission 1 defines sounds in WandMassacre\maps\c10m1_caves_level_sounds.txt

"Melee.Wand.Miss"
{
"channel" "CHAN_WEAPON"
"soundlevel" "SNDLVL_NORM"
"rndwave"
{
"wave" "weapons/wand/miss_1.mp3"
"wave" "weapons/wand/miss_2.mp3"
"wave" "weapons/wand/miss_3.mp3"
"wave" "weapons/wand/hit_wall_1.mp3"
"wave" "weapons/wand/hit_wall_2.mp3"
"wave" "weapons/wand/attack.mp3"
}
}

That label is used in the weapon script: WandMassacre\scripts\melee\wand.txt

// Sound data
// define the hit and miss sounds
SoundData
{
"melee_miss" "Melee.Wand.Miss"
"melee_hit" "Melee.Wand.Hit"
"melee_hit_world" "Melee.Wand.HitWorld"
}

The sound files are at:

WandMassacre\sound\weapons\wand\miss_1.mp3
WandMassacre\sound\weapons\wand\miss_2.mp3
WandMassacre\sound\weapons\wand\miss_3.mp3

More info can be found at https://developer.valvesoftware.com/wiki/L4D2_Custom_Sound_and_Music_Tutorial
12 Comments
XCT3  [author] 24 Feb, 2018 @ 8:57am 
Apparently your custom music is not at that location on the disk, MV. "@#" doesn't look like any placeholder i've seen before.
Free TraumaTeam Service 19 Feb, 2018 @ 2:31pm 
Any idea what is this problem cause i left L4D2 for a couple of days cause i was sick and then this Error starts appearing not letting the game playing the custom music
"
S_StartSound: Failed to load sound '@#music\stmusic\deadeasy.wav', file probably missing from disk/repository"
XCT3  [author] 22 May, 2016 @ 12:22am 
Please be specific about any error.
killerphantom0 21 May, 2016 @ 1:58am 
how to fix it on mac ?
pls teach me , i really fed up with this error
MILKDRAINER 12 Apr, 2014 @ 2:11am 
thx!
Haircut Police 9 Apr, 2014 @ 4:58am 
Quick question: Any way to make multiple sounds for one weapon that play in order when weapon is fired?
Haircut Police 9 Apr, 2014 @ 4:57am 
It works! I figured it out! Something i think you need to add to the guide; The vpk.exe was missing from my files. If anybody has the same problem, just google a download for it, pick the first result, it works just the same as the one that should have been there anyway. DO NOT USE VPK.EXE FROM OTHER GAMES: it causes L4D2 to crash and be unplayable until you uninstall the mod you made using them.
Haircut Police 9 Apr, 2014 @ 4:39am 
Ok, that's fixed, and the add-on is installed, but i still get no sounds... confusing...
Haircut Police 9 Apr, 2014 @ 2:43am 
wait, fixed that. NOW when i run the game i get "unknown Version 2 for (my file directory and name.vpk)", then it crashes... sorry for all these noobish comments, but i have to get this right.
Haircut Police 9 Apr, 2014 @ 2:05am 
It's step 8 i'm stuck on, I can't find the .exe file you mention, and if you are meant to create one I don't know how.