Left 4 Dead 2

Left 4 Dead 2

Not enough ratings
Edit *.vpk file (Left 4 Dead 2)
By Artillery Rain
You look at those fantastic mod from workshop and want to look inside them to further admire their work. But... you won't be satisfied just by looking at it right? This guide will go in detail what each folder and file in a *.vpk do to your L4D2 .
Note: I will only talk about model mod since it's the kind plaguing workshop the most.
   
Award
Favorite
Favorited
Unfavorite
Introduction
I assume you know how to unpack and view content of .vpk . You see a bunch of folder and file and know it need to be like that or the mod won't work right. Like they said, don't touch anything unless you know what to do. So i will go in detail what file do what thing, what you can customize to pack a working .vpk .
I don't have time to read all this thing. Summarize !
A model replacement mod will look like this.

_"materials" :
___"models" : DON'T TOUCH
___"vgui" : removable

_"models" : do NOT touch, but in case you want to apply texture to a respective model, you need to remove this, more detail later

_"sound" : removable

_"addoninfo.txt" : depend, more detail later, but still removable

Repack your .vpk and place it in "addons" folder in game directory. Dinner served.
"materials"
This folder contain texture that will be applied to the model in "models" folder. Without it (or incorrect set), model won't have any texture and game will apply error texture instead (black and pink checker).

That said, even if you remove "materials" folder, you can still use model in game, but it would look like above, and no one love that.

Let's skip all other subfolder except the one your model will use.

Why does it need to have so many subfolder to get to the texture itself ? It depends on the .qc file when compiling model. Actually you can set it to whatever you can think of, and it can be as long as your browser history.

simple address:
.
more address:
*Note: In this .qc the material address refer to nowhere within "materials" in current .vpk, but model will still look for texture at that location regardless. If there are any enabled .vpk having texture in that exact address, model will use that texture too.

**Advanced Note: When creating *.smd (that would later be compiled using Crowbar, *.qc and other stuffs), creator can choose what texture will be applied to model. Those texture have a name, and *.smd only care about that name.

If at those material address have the texture with correct name, those texture will be applied. If there are texture but model doesn't use, those texture are garbage. If there are texture with same name at different address, the upper address will be prioritized. If after looking at all address but model can't get enough texture, the missing texture will be replaced by black and pink checker (see above).

even more address:
.
That explained why you shouldn't mess up those subfolder. Now to the innermost subfolder that contain texture. There are *.vtf ( the texture itself ) and *.vmt ( a text file which tell the game how to apply texture to model ). With according knowledge you can make change to them.

See also:
"A little Eileen" guides
List Of Material Proxies

Oh and the "vgui" folder, it contain texture that applies to HUD or menus. You can mess it up, it won't affect the model.
"models"
You know what this protagonist do. You only have 2 choices, stay away from them or delete them. What does that mean?
As you know, file which have v_ is model show only in firstperson view, and file with w_ is model show in environment. Let's say for some reason you want to delete them, you totally can. The remaining is what will work when you play.
For example, you love COD:MW2019 weapons, but all those model are too detailed and make your PC worn out, simply get rid of "w_models" folder and try again. At this time the .vpk will only mod your holding gun, not that same gun but on table or in other's hand.
Another example, you want CS:GO skin for your CS:GO weapon. You need to delete this whole "models" folder or else the model will either use another animation (with new skin) or no change at all.

*Note: If you going to put in "w_models" from another .vpk , be sure to copy their "materials" too or you will get fancy black and pink error.
"sound"
Same warning, don't mess up those subfolder. Look straight to .wav file, replace them with something you want, but pay attention to it's sample rate. If your .wav doesn't match the one game use (each .wav file may have different sample rate), it won't work well even if you snd_rebuildaudiocache .
What about bitrate? It's just your audio's quality, higher mean better but since it's .wav it's size will be huge, especially if you gonna mod music, have mercy because too high quality for too long length will make your game sweat (your game, not your PC).

See also:
How To Create Sound Mod .vpk's
L4D2 Custom Sound and Music Tutorial
"addoninfo.txt"
Allow me to seperate 2 route:

Route 1: You manage your mod outside the game by moving them to / from "addons" folder in game's directory

"addoninfo.txt" isn't necessary to you...
Hey keep reading, important part below.

Route 2: You manage your mod inside the game by using addons menu

Remember, your mod will only appear in menu if .vpk have "addoninfo.txt" . So if it don't, it won't appear BUT still enabling and working just fine. There is only one problem, hidden mod WILL BE PRIORITIZED over all non-hidden mod (all hidden mod are prioritized by alphabet order, A -> Z ). Also note that since hidden mod doesn't appear on menu, there won't be any conflict warning.

*What if you get mod by subscribing?
"addoninfo.txt" will be ignored. If you get mod this way but then unsub and move it to "addons" folder. It will show info from "addoninfo.txt".
Bonus: Manage your addon menu
So you subscribed or downloaded all kind of mod and continue to seek more although you know they can't enable all at same time. You then get into addon menu (in game), and you get depression...
Where is gun mod? Where is Honkai Impact? Where is anime concert? Where is my nude Zoey? Where is my R18 spray? WTF is this Chinese mod? Where is skybox mod i subbed last month?
Ok you spend your breakfast while checking those tiny box. Each year you bring 10GB of mod and pour into "addons" folder. Each time you want to use another mod, you navigate through a list longer than your textbook. Ok your mental is strong, you have time, you get used to it.
One day, your PC die. Ohhhh you can't enjoy your meal. You get to internet cafe while waiting to buy another PC. You download game again, but game don't allow you to play yet because you haven't had all the mod you subbed. YES finally it's done but... they all enabled. You bring this experience and depression to your bed. Then when you get new PC, you repeat all those step again and this time you backup your whole L4D2 folder. Problem solved.
.
.
.
Oh someone talked about this, i have been waiting all this time! Here it is:
https://steamhost.cn/steamcommunity_com/app/550/discussions/0/1621726179579934865/

Save me the trouble to go through it here ;)
I get mod through Crowbar so organizing them is easier.
Real Bonus: Loading your mod and "addonlist.txt"
"addonlist.txt" will be loaded upon entering addon menu.
New mod will be loaded upon exiting addon menu, and also upon launching game. New mod will always be set to enable by default.
If you make change to "addonlist.txt" while in addon menu, upon exiting the change will be reverted !
End of guide
Hope you find my guide useful and easy to understand. Have a nice day.

Unused pic:
6 Comments
Sweets 28 Aug, 2022 @ 12:17pm 
Aw thank you so much Artillery Rain you were very helpful to me today. I hope i wasn't to much of a bother. It's hard to get creators to do mod request only one nice man from china did delacey mod from project neural for me. But i will surely keep you in mind for Weapon information if i cant find what im looking for anywhere else... Again thank you very much.:steamthumbsup:
Artillery Rain  [author] 28 Aug, 2022 @ 12:06pm 
While there are many group for modder to help each other , i believe they would rather share a guide than talk about it everytime people ask them . But you can always ask me and i will answer what i can .
Artillery Rain  [author] 28 Aug, 2022 @ 12:03pm 
@Nana Moo
The progress from getting custom model to make them work in L4D2 would cost you a day because there are many thing to do . Same for mod from Gmod , if it's weapon you can reuse model and animation ( need some tweak so it can work well because it replace another gun in L4D2 ) ; but if it's character i afraid you can only scavenge the model itself , then rig it from scratch ( you may keep their bones for proportion trick ) .
For jigglebone , it's a pretty easy work . But for flex face animation you need more rigging and file writing . I don't know about real-human like character , but for those anime one , flex face doesn't look so fancy to me ( sometime i think it ruin their face ) .
Sweets 28 Aug, 2022 @ 11:51am 
Aw wow thank you for taking the time to reply to me. I totally understand i did read through some guides/tutorials they confuse me as well. I guess i will just have to learn by myself then. Each person has a different way or method to do mods i guess i need to find my own way as well as pulling bits and pieces from everyone else. Thats just life but thank you for your response.
Artillery Rain  [author] 28 Aug, 2022 @ 11:45am 
There are many tutorial for making character mod . I suggest you try to read them first before requesting me .
Reason why i don't write guide for it are :
- While most people use Blender (which i've never used) , i use 3DS Max (which is purchasable) , and it's 3DS Max 2010 , much more difficult to use .
- I learned making mod mostly from scratch because reading people's guide doesn't help me understand how things work . And to understand each and every progress , the guide would be very long and there are many topic / problem that need further discussion .
- Like i said i learned by myself , there are still many more i have yet to learn ( also i'm satisfied with my capable now ) .
Sweets 28 Aug, 2022 @ 4:10am 
Can you do one for character models ? For instance when we download a character model from RE or some sort of anime mod and want to apply it to Nick or zoey or when we sub a Gmod and want to use it for a l4d2 character instead? Steps 1 - 2 what we need and what we need to do for jigglebones and flexi movement and correct rigging for the joints to guns and melee?