Left 4 Dead 2

Left 4 Dead 2

286 ratings
Editing VPK's
By Zaeryn
So, you downloaded my latest super-awesome mod, but it has sounds, icons or something else you don't want. Since I'm not going to upload 500 different versions of the same mod to please everyone, why not learn how to remove it yourself?

What you can do:
  • change/remove HUD icons
  • change/remove scripts
  • change/remove sounds
  • change materials (VMT's)
  • change textures (VTF's)
  • remove part of a model assigned to one material

What you can't do (without recompiling):
  • switch/edit animations
  • remove part of a model assigned to multiple materials
  • move parts of a model around
  • make one survivor replace another
3
   
Award
Favorite
Favorited
Unfavorite
Setup
Download and install these:

GCFScape.[nemesis.thewavelength.net]

Left 4 Dead 2 Authoring Tools



Make sure you run Model Viewer at lease once before continuing.


Now we're done with model viewer and authoring tools; you can close them.

Let's make things as simple as possible. Once you associate VPK's with GCFScape, any time you double-click one, it will open using that program. Find any VPK, right-click it and choose Open with... > Choose default program.

Select GCFScape and make sure "always use the selected program" is checked on.

If GCFScape isn't here, click browse to manually locate its EXE file.

Navigate to your Left 4 Dead 2 tools directory. It's usually in
C:\Program Files (x86)\Steam\SteamApps\common\Left 4 Dead 2\bin

Right-click vpk.exe and select "create shortcut". Now cut (ctrl + x) and paste (ctrl + p) it into
C:\Program Files (x86)\Steam\SteamApps\common\Left 4 Dead 2\left4dead2\addons
Unpack the VPK
Addon VPK's are in your addons folder and the workshop crud you're subscribed to is in addons/workshop. Simple, right?

If it's from the workshop, go to addons/workshop and look at the JPG images. If you see a picture of a big fat turd on the workshop mod you want to edit, find that JPG of a big fat turd in addons/workshop. Its filename consists of a bunch of numbers. The VPK with the same set of numbers is the one you want, so cut+paste that into addons then unsubscribe from it on the workshop.

Either way, find the VPK you want to edit and double-click that biznatch. Drag and drop the "root" folder wherever you want (I recommend addons). If GCFScape sheets itself and crashes, right-click the "root" folder and choose extract.

All VPK's are extracted as the "root" folder, so you may want to rename it afterwards.
Remove some shi t
Open your newly-extracted addon folder (called "root" if you've been a dummy and haven't renamed it). Don't move shi'ht around unless you know what you're doing. Anyway, if you don't want the sounds, delete the sound folder. If you don't want the icons, delete scripts. You get the picture.
Optional: Make ♥♥♥♥♥ invisible with $no_draw 1
What if you want to remove a super awesome scope because it's totes not realisitc, bro? Read on.

Open root/materials and find the material (VMT) of the model you want to hide. All you have to add is "$no_draw 1". Here's an example.
VertexLitGeneric { $no_draw 1 $baseTexture "models/v_models/weapons/trh1911/laserdot" }
These are the only lines you need; you can delete any others. Just make sure to retain both brackets { } or L4D2's console will swear at you.
Pack the VPK
If you've payed attention so far and made a shortcut to vpk.exe, now all you have to do is drag & drop your addon (root) folder onto the shortcut and it will be packed into a VPK in the same directory as the folder.

That's it! Merry Christmas/Hanukkah/Kwanzaa/Festivus/Flyingspaghettimonstermas to everyone!