GETTING A MODEL INTO L4D

1. Decompiling the Original Models
2. Rigging and Saving the Model
3. The QC File
4. Compiling and Model Files
5. The VPK and Whitelist
6. Additional


1. Decompiling the Original Models

Firstly, download MDLDecompiler version 0.4.1, it seems to be the only version that works. You can get that here :
http://www.chaosincarnate.net/cannonfodder/mdldecompiler.php

I assume you have extracted your gcf's already, if not, follow this tutorial :
http://www.fpsbanana.com/tuts/7355

Unzip MDLDecompiler to "C:\Program Files\Valve\Steam\SteamApps\raptorred@planetavp.com\sourcesdk\bin\ep1\bin". It is easiest if you create a shortcut from it to your desktop or l4d tools location.

Once you have done this, create a folder where you will want to decompile your models to. Find the model you wish to decompile from the files you extracted and copy the mdl, vvd, phy, and vtx to your new decompiled model folder. Make TWO copies of the vtx file and rename the endings to .dx90.vtx and .dx80.vtx (for example, survivor_namvet.dx90.vtx and survivor_namvet.dx80.vtx).

Open the mdl file in either a hex editor, Notepad++ or EditPlus, find where it says "IDST1" and change it to say "IDST," and then save it.

Now open up MDL Decompiler, browse to your mdl file and to you decompile folder, turn OFF steam access, and decompile. It should have now created 11 new files (assuming it's a player model) in your decompiled model folder.


2. Rigging and Saving the Model

I'll start off by assuming you know how to make a model.

You will need to get these .smd files so you can use the original skeletons. Load the file with the "reference_wrinkle.dmx.smd" ending for whichever character you are replacing into your favourite modeling program and rig up (connecting the mesh to the skeleton) your model. I would suggest moving the mesh to fit the skeleton rather than moving the skeleton at all as this messes up models in other games.

Export your .smd file to your working folder. This folder should contain a number of files :

1. the smd file, named whatever you like
2. a "phymodel.smd"
3. a .qc file, again named whatever you like.

I will assume you know how to make a texture, if not, go check out one of the skinning tutorials.
Place the .vtf and .vmt files you have in a folder
C:\Program Files\Valve\Steam\SteamApps\common\left 4 dead\left4dead\materials\models\survivors\
then into a folder where you can keep track of it. I put mine into Bill's folder, namvet.
C:\Program Files\Valve\Steam\SteamApps\common\left 4 dead\left4dead\materials\models\survivors\namvet\
This path is chosen in the .qc file (in the next section of the tutorial ) in any case.


3. The QC File

There is working .qc files for each character in the download above.
Now lets go over all the parts of it that need changing.

$cd "C:\Program Files\Valve\Steam\SteamApps\common\left 4 dead\left4dead\tools\Misc\nathan"
This should point to the folder where your three files are.

$modelname "survivors/survivor_namvet.mdl"
Leave this as the name of the character you want to replace. It won't overwrite the file unless you have it extracted to here, so back it up if you do and want to keep the original..

$model "Repo" "repo.smd"
Rename the first quoted part to whatever you want, remember though that it will be used again for the sequence. Rename the second quoted part to the exact name of your smd file. Apparently leaving this as the original (namvet, etc), will cause the model not to be compile for some reason.

$cdmaterials "models\survivors\NamVet\"
Really you don't need to change this, this is just pointing to the folder UNDER THE MATERIALS FOLDER, where your textures for your model are going to go. If you plan to put them in the folder of the character you are replacing, leave namvet if you are replacing Bill, biker for Francis, manager for Louis or teenangst for Zoey.

$texturegroup skinfamilies
{
{ "repo.vmt" }
{ "repoman_it.vmt" }

This is the list of vmt files which point to the textures that your model uses. Now I'm not sure about the texture_it.vmt part.. as far as I can tell, it doesn't actually use this and I just left it in to be safe.. if anyone figures out different, please tell me. Change the name to whatever.vmt you want. If you have multiple textures, just combine them in the brackets, for example :

{ "repo.vmt"
"repo1.vmt" }

Most of the original player models have about four textures each.

$includemodel "survivors/anim_namvet.mdl"
$includemodel "survivors/gestures_namvet.mdl"

Again just replace "namvet" with whatever character you are replacing. Namvet for Bill, biker for Francis, manager for Louis and teenangst for Zoey. You probably should also have these extracted from the vpk and in the right folder under Models just in case.

$sequence Repo "Repo" fps 30.00
Rename both instances of Repo here to whatever you called the model before in the $model "Repo" "repo.smd" line, in the first set of quotations.

That should be just about all in the .qc file. The rest can generally be left, though you will probably want to keep the joint collision info from whichever character you used the skeleton from.


4. Compiling

Now compiling is the easy part. When you have your .qc file changed to what you want, drag it over to this folder, BUT DON"T DROP IT IN!
C:\Program Files\Valve\Steam\SteamApps\common\left 4 dead\bin
Drag it over top of StudioMDL.exe and drop it onto that exe. A window should come up, run through a bunch of stuff, finish and disappear in a matter of seconds. Check this folder to make sure your files have been created :
C:\Program Files\Valve\Steam\SteamApps\common\left 4 dead\left4dead\models\survivors\

You should now have four new files in your survivors folder.


5. The VPK and Whitelist

I recommend always making a backup of your VPK, or any other files you are replacing.

Open up "pak01_dir.vpk" from your main left4dead folder using either a Hex Editor, Notepad++ or EditPlus, search for the entry "survivor_" then whichever character you are replacing (survivor_namvet for example), and rename it to something else but WITH THE SAME NUMBER OF LETTERS as the original name. From what I've read, if you don't do this, you get a checksum error ingame. From what I can tell, also, it won't matter what you rename it to, since this forces the game to go looking for the original named .mdl file in the folder (survivor_namvet.mdl). There are four entries in the vpk to change, then save the vpk.

For skinning, most of the tutorials say to add a line to the whitelist. I removed that line from mine and tested and it made no difference, the model and skin still worked absolutely fine.


6. Additional

Now you should be ready to test ingame! Go into your menu, use the console and put in "sv_consistency 0" and go into a game and it should work. If it doesn't, open up the console and look for any errors that it gives you. This is really handy to point you in the right direction. If the game simply crashes, there are a number of things that can cause this , though the most likely is you corrupted tthe vpk using plain notepad or something. Back track over every step, make sure you didn't name something wrong or mess up the vpk file. If that still doesn't work, you can PM me or email me and I'll try to help you.

If it works.... congrats! lol
Have fun with your new model!



by Shilo
xfire : rrdfraptorred
steam : raptorred@planetavp.com
email : raptorred@raptorred.com

Send me a PM