Resources

[TUT]Getting Player Models InGame

[TUT]Getting Player Models InGame

Postby Shilo » 07 Jun 2009 16:32

Image
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

Or if you don't want to go through all the trouble of decompiling, here are the character models decompiled by samm5506. Thanks samm!
http://files.filefront.com/13892589/

Unzip MDLDecompiler to "C:\Program Files\Valve\Steam\SteamApps\yourusername\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).
Image

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

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 a number of (somewhere around 10) new files 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 using the "Skin" modifier. 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.
Image

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.
Image

3. The QC File

Open up the qc file that was created when you decompiled.
Let's go over all the parts of it that need changing.

Remove all the LOD information that is near the top. Leaving this in prevents the model from compiling. This is an example of what should be removed:
Code: Select all
$lod 10
{
  replacemodel "NamVet_reference_wrinkle.dmx" "lod1_NamVet_reference_wrinkle.dmx"
}
$lod 15
{
  replacemodel "NamVet_reference_wrinkle.dmx" "lod2_NamVet_reference_wrinkle.dmx"
}
$lod 25
{
  replacemodel "NamVet_reference_wrinkle.dmx" "lod3_NamVet_reference_wrinkle.dmx"
}
$lod 40
{
  replacemodel "NamVet_reference_wrinkle.dmx" "lod4_NamVet_reference_wrinkle.dmx"
}
$shadowlod
{
  replacemodel "NamVet_reference_wrinkle.dmx" "lod5_NamVet_reference_wrinkle.dmx"
}


Here is a working qc file as an example.
Code: Select all
    $cd "C:\Program Files\Valve\Steam\SteamApps\common\left 4 dead\left4dead\tools\Misc\nathan"
    $modelname "survivors/survivor_namvet.mdl"
    $model "Repo" "repo.smd" {
         mouth 0 "mouth"  ValveBiped.Bip01_Head1 0.000 1.000 0.000
    }

    $poseparameter body_pitch -90.00 90.00 360.00
    $poseparameter body_yaw -90.00 90.00 360.00
    $poseparameter head_pitch -90.00 90.00 360.00
    $poseparameter head_yaw -90.00 90.00 360.00
    $cdmaterials "models\survivors\NamVet\"
    $cdmaterials "models\survivors\"
    $cdmaterials ""
    $texturegroup skinfamilies
    {
       {"repo.vmt"
    }
    {"repoman_it.vmt"
    }
       
    }

    $attachment "eyes" "ValveBiped.Bip01_Head1" 3.56 -2.83 0.01 rotate 0.00 -89.37 -90.00
    $attachment "mouth" "ValveBiped.Bip01_Head1" 0.80 -5.80 -0.15 rotate -0.00 -80.00 -90.00
    $attachment "pistol" "ValveBiped.Bip01_R_Thigh" 3.31 0.69 -6.64 rotate -11.66 3.42 83.61
    //$attachment "cigarette" "ValveBiped.Bip01_Head1" -0.09 -5.01 1.82 rotate -31.69 -89.37 0.00
    $attachment "medkit" "ValveBiped.Bip01_Spine4" -1.27 -5.57 -1.31 rotate 5.03 77.16 0.00
    $attachment "primary" "ValveBiped.Bip01_Spine4" 3.05 -4.91 -2.62 rotate -13.70 170.19 174.29
    $attachment "attach_R_shoulderBladeAim" "ValveBiped.Bip01_Spine4" -10.54 -1.39 -5.08 rotate -90.00 -102.85 0.00
    $attachment "attach_L_shoulderBladeAim" "ValveBiped.Bip01_Spine4" -10.54 -1.39 3.51 rotate -90.00 -102.85 0.00
    $attachment "molotov" "ValveBiped.Bip01_Spine" -3.59 -2.79 7.97 rotate -63.44 -74.67 -101.41
    $attachment "grenade" "ValveBiped.Bip01_Spine" -2.29 1.19 8.98 rotate -90.00 -175.23 0.00
    $attachment "pills" "ValveBiped.Bip01_Spine" -2.96 0.71 -8.06 rotate -41.18 -88.48 -87.05
    $attachment "lfoot" "ValveBiped.Bip01_L_Foot" 0.00 5.00 -0.00 rotate 0.00 0.00 0.00
    $attachment "rfoot" "ValveBiped.Bip01_R_Foot" 0.00 5.00 -0.00 rotate -0.00 -0.00 -0.00
    $attachment "muzzle_flash" "ValveBiped.Bip01_L_Hand" 0.00 0.00 0.00 rotate 0.00 0.00 0.00
    $attachment "survivor_neck" "ValveBiped.Bip01_Neck1" 0.00 -0.00 0.00 rotate -0.00 0.00 -0.00
    $attachment "forward" "ValveBiped.forward" 0.00 0.00 0.00 rotate 0.00 -0.00 -0.00
    $attachment "bleedout" "ValveBiped.Bip01_Pelvis" 9.50 10.00 5.00 rotate -0.00 0.00 0.00
    $attachment "survivor_light" "ValveBiped.Bip01_Spine2" 6.00 24.00 -0.00 rotate 0.00 -0.00 -0.00
    $attachment "legL_B" "ValveBiped.attachment_bandage_legL" 0.00 0.00 0.00 rotate -90.00 -90.00 0.00
    $attachment "armL_B" "ValveBiped.attachment_bandage_armL" 0.00 0.00 0.00 rotate -90.00 -90.00 0.00
    $attachment "armL_T" "ValveBiped.attachment_armL_T" 0.00 0.00 0.00 rotate -90.00 -90.00 0.00
    $attachment "armR_T" "ValveBiped.attachment_armR_T" 0.00 0.00 0.00 rotate -90.00 -90.00 0.00
    $attachment "armL" "ValveBiped.Bip01_L_Forearm" 0.00 0.00 0.00 rotate -0.00 0.00 0.00
    $attachment "legL" "ValveBiped.Bip01_L_Calf" 0.00 0.00 0.00 rotate -0.00 0.00 0.00
    $attachment "thighL" "ValveBiped.Bip01_L_Thigh" 0.00 0.00 0.00 rotate -0.00 0.00 0.00
    $attachment "spine" "ValveBiped.Bip01_Spine" 0.00 -0.00 0.00 rotate -90.00 -90.00 0.00
    $includemodel "survivors/anim_namvet.mdl"
    $includemodel "survivors/gestures_namvet.mdl"
    $surfaceprop "flesh"
    $eyeposition -0.000 0.000 70.000
    $illumposition -0.236 -0.077 36.138
    $sequence Repo "Repo" fps 30.00
    $sequence ragdoll "ragdoll" ACT_DIERAGDOLL 1 fps 30.00
    $ikchain rhand ValveBiped.Bip01_R_Hand knee  0.707 0.707 0.000
    $ikchain lhand ValveBiped.Bip01_L_Hand knee  0.707 0.707 0.000
    $ikchain rfoot ValveBiped.Bip01_R_Foot knee  0.707 -0.707 0.000
    $ikchain lfoot ValveBiped.Bip01_L_Foot knee  0.707 -0.707 0.000
    $ikchain ikclip ValveBiped.weapon_bone_Clip knee  0.707 -0.707 0.000
    $collisionjoints "phymodel.smd" {

       $mass 100.0
       $inertia 10.00
       $damping 0.05
       $rotdamping 5.00
       $rootbone "valvebiped.bip01_pelvis"
       $jointrotdamping "valvebiped.bip01_pelvis" 3.00

       $jointmassbias "valvebiped.bip01_spine1" 8.00
       $jointconstrain "valvebiped.bip01_spine1" x limit -10.00 10.00 0.00
       $jointconstrain "valvebiped.bip01_spine1" y limit -16.00 16.00 0.00
       $jointconstrain "valvebiped.bip01_spine1" z limit -20.00 30.00 0.00

       $jointmassbias "valvebiped.bip01_spine2" 9.00
       $jointconstrain "valvebiped.bip01_spine2" x limit -10.00 10.00 0.00
       $jointconstrain "valvebiped.bip01_spine2" y limit -10.00 10.00 0.00
       $jointconstrain "valvebiped.bip01_spine2" z limit -20.00 20.00 0.00

       $jointmassbias "valvebiped.bip01_r_clavicle" 4.00
       $jointrotdamping "valvebiped.bip01_r_clavicle" 6.00
       $jointconstrain "valvebiped.bip01_r_clavicle" x limit -15.00 15.00 0.00
       $jointconstrain "valvebiped.bip01_r_clavicle" y limit -10.00 10.00 0.00
       $jointconstrain "valvebiped.bip01_r_clavicle" z limit -0.00 45.00 0.00

       $jointmassbias "valvebiped.bip01_l_clavicle" 4.00
       $jointrotdamping "valvebiped.bip01_l_clavicle" 6.00
       $jointconstrain "valvebiped.bip01_l_clavicle" x limit -15.00 15.00 0.00
       $jointconstrain "valvebiped.bip01_l_clavicle" y limit -10.00 10.00 0.00
       $jointconstrain "valvebiped.bip01_l_clavicle" z limit -0.00 45.00 0.00

       $jointmassbias "valvebiped.bip01_l_upperarm" 5.00
       $jointrotdamping "valvebiped.bip01_l_upperarm" 2.00
       $jointconstrain "valvebiped.bip01_l_upperarm" x limit -15.00 20.00 0.00
       $jointconstrain "valvebiped.bip01_l_upperarm" y limit -40.00 32.00 0.00
       $jointconstrain "valvebiped.bip01_l_upperarm" z limit -80.00 25.00 0.00

       $jointmassbias "valvebiped.bip01_l_forearm" 4.00
       $jointrotdamping "valvebiped.bip01_l_forearm" 4.00
       $jointconstrain "valvebiped.bip01_l_forearm" x limit -40.00 15.00 0.00
       $jointconstrain "valvebiped.bip01_l_forearm" y limit 0.00 0.00 0.00
       $jointconstrain "valvebiped.bip01_l_forearm" z limit -120.00 10.00 0.00

       $jointrotdamping "valvebiped.bip01_l_hand" 1.00
       $jointconstrain "valvebiped.bip01_l_hand" x limit -25.00 25.00 0.00
       $jointconstrain "valvebiped.bip01_l_hand" y limit -35.00 35.00 0.00
       $jointconstrain "valvebiped.bip01_l_hand" z limit -50.00 50.00 0.00

       $jointmassbias "valvebiped.bip01_r_upperarm" 5.00
       $jointrotdamping "valvebiped.bip01_r_upperarm" 2.00
       $jointconstrain "valvebiped.bip01_r_upperarm" x limit -15.00 20.00 0.00
       $jointconstrain "valvebiped.bip01_r_upperarm" y limit -40.00 32.00 0.00
       $jointconstrain "valvebiped.bip01_r_upperarm" z limit -80.00 25.00 0.00

       $jointmassbias "valvebiped.bip01_r_forearm" 4.00
       $jointrotdamping "valvebiped.bip01_r_forearm" 4.00
       $jointconstrain "valvebiped.bip01_r_forearm" x limit -40.00 15.00 0.00
       $jointconstrain "valvebiped.bip01_r_forearm" y limit 0.00 0.00 0.00
       $jointconstrain "valvebiped.bip01_r_forearm" z limit -120.00 10.00 0.00

       $jointrotdamping "valvebiped.bip01_r_hand" 1.00
       $jointconstrain "valvebiped.bip01_r_hand" x limit -25.00 25.00 0.00
       $jointconstrain "valvebiped.bip01_r_hand" y limit -35.00 35.00 0.00
       $jointconstrain "valvebiped.bip01_r_hand" z limit -50.00 50.00 0.00

       $jointmassbias "valvebiped.bip01_r_thigh" 7.00
       $jointrotdamping "valvebiped.bip01_r_thigh" 7.00
       $jointconstrain "valvebiped.bip01_r_thigh" x limit -25.00 25.00 0.00
       $jointconstrain "valvebiped.bip01_r_thigh" y limit -10.00 15.00 0.00
       $jointconstrain "valvebiped.bip01_r_thigh" z limit -55.00 25.00 0.00

       $jointmassbias "valvebiped.bip01_r_calf" 4.00
       $jointconstrain "valvebiped.bip01_r_calf" x limit -10.00 25.00 0.00
       $jointconstrain "valvebiped.bip01_r_calf" y limit -5.00 5.00 0.00
       $jointconstrain "valvebiped.bip01_r_calf" z limit -10.00 115.00 0.00

       $jointrotdamping "valvebiped.bip01_r_foot" 2.00
       $jointconstrain "valvebiped.bip01_r_foot" x limit -20.00 30.00 0.00
       $jointconstrain "valvebiped.bip01_r_foot" y limit -30.00 20.00 0.00
       $jointconstrain "valvebiped.bip01_r_foot" z limit -30.00 50.00 0.00

       $jointmassbias "valvebiped.bip01_l_thigh" 7.00
       $jointrotdamping "valvebiped.bip01_l_thigh" 7.00
       $jointconstrain "valvebiped.bip01_l_thigh" x limit -25.00 25.00 0.00
       $jointconstrain "valvebiped.bip01_l_thigh" y limit -10.00 15.00 0.00
       $jointconstrain "valvebiped.bip01_l_thigh" z limit -55.00 25.00 0.00

       $jointmassbias "valvebiped.bip01_l_calf" 4.00
       $jointconstrain "valvebiped.bip01_l_calf" x limit -10.00 25.00 0.00
       $jointconstrain "valvebiped.bip01_l_calf" y limit -5.00 5.00 0.00
       $jointconstrain "valvebiped.bip01_l_calf" z limit -10.00 115.00 0.00

       $jointrotdamping "valvebiped.bip01_l_foot" 2.00
       $jointconstrain "valvebiped.bip01_l_foot" x limit -20.00 30.00 0.00
       $jointconstrain "valvebiped.bip01_l_foot" y limit -30.00 20.00 0.00
       $jointconstrain "valvebiped.bip01_l_foot" z limit -30.00 50.00 0.00

       $jointmassbias "valvebiped.bip01_head1" 4.00
       $jointrotdamping "valvebiped.bip01_head1" 3.00
       $jointconstrain "valvebiped.bip01_head1" x limit -50.00 50.00 0.00
       $jointconstrain "valvebiped.bip01_head1" y limit -20.00 20.00 0.00
       $jointconstrain "valvebiped.bip01_head1" z limit -26.00 30.00 0.00
    }


$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 the smd is called, it will be used again for the sequence part as well. 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. I put six textures in at one point as a test and that killed the character on load of the game for some.. odd.. reason.

$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 the same name as your smd file.

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.
Image

A window should come up, run through a bunch of stuff, finish and disappear in a matter of seconds.
Image

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.
Image

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!

Image

*EDIT*
Links to other modeling tutorials :

Modeling
http://www.3dtotal.com//team/Tutorials_3/Clone_modelling/clone_modelling_01.php
http://www.3dtotal.com/team/Tutorials_3/Box_modeling_video_tutorial/Box_modeling01.php
http://www.3dtotal.com/team/Tutorials_3/head_modeling_3dsmax/head_modeling_3dsmax_01.php

UV Mapping
http://www.3dtotal.com/team/Tutorials_3/head_mapping/head_mapping_01.php

Rigging

http://www.youtube.com/watch?v=MRikV-jTFfc
Last edited by Shilo on 18 Mar 2010 21:06, edited 5 times in total.
User avatar
Shilo
Smoker
Smoker
 
Posts: 140
Joined: 07 Jun 2009 15:59
Location: Toronto, Ontario, Canada
Title: Legal Assassin
Steam ID: Shilo_Wallace
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby Arctic0ne » 07 Jun 2009 18:50

Great guide, man. Except when I drop my .qc file into studiomdl, it doesn't create a .mdl file. I can't find the one it was suppose to create anywhere. :((

Btw, what I am trying to do is port CS:S models into L4D.

User avatar
Arctic0ne
28 Posts later
28 Posts later
 
Posts: 36
Joined: 05 Dec 2008 21:10
Location: Ohio, United States
Steam ID: Arctic0ne
XBL: Arctic_0ne

Re: [TUT]Getting Player Models InGame

Postby Shilo » 07 Jun 2009 20:36

Well, if it does create the mdl it creates it in the "$modelname" location.
For example "$modelname "survivors/survivor_namvet.mdl""
creates it in
C:\Program Files\Valve\Steam\SteamApps\common\left 4 dead\left4dead\models\survivors\survivor_namvet.mdl

Make sure that location is right. Also if you are using the straight CS:S qc file, there may be extra information in it that the l4d studiomdl doesn't like. Take a look at my qc file and compare it to yours to make sure.

Code: Select all
$cd "C:\Program Files\Valve\Steam\SteamApps\common\left 4 dead\left4dead\tools\Misc\nathan"
$modelname "survivors/survivor_namvet.mdl"
$model "Repo" "repo.smd" {
     mouth 0 "mouth"  ValveBiped.Bip01_Head1 0.000 1.000 0.000
}

$poseparameter body_pitch -90.00 90.00 360.00
$poseparameter body_yaw -90.00 90.00 360.00
$poseparameter head_pitch -90.00 90.00 360.00
$poseparameter head_yaw -90.00 90.00 360.00
$cdmaterials "models\survivors\NamVet\"
$cdmaterials "models\survivors\"
$cdmaterials ""
$texturegroup skinfamilies
{
   {"repo.vmt"
}
{"repoman_it.vmt"
}
   
}

$attachment "eyes" "ValveBiped.Bip01_Head1" 3.56 -2.83 0.01 rotate 0.00 -89.37 -90.00
$attachment "mouth" "ValveBiped.Bip01_Head1" 0.80 -5.80 -0.15 rotate -0.00 -80.00 -90.00
$attachment "pistol" "ValveBiped.Bip01_R_Thigh" 3.31 0.69 -6.64 rotate -11.66 3.42 83.61
//$attachment "cigarette" "ValveBiped.Bip01_Head1" -0.09 -5.01 1.82 rotate -31.69 -89.37 0.00
$attachment "medkit" "ValveBiped.Bip01_Spine4" -1.27 -5.57 -1.31 rotate 5.03 77.16 0.00
$attachment "primary" "ValveBiped.Bip01_Spine4" 3.05 -4.91 -2.62 rotate -13.70 170.19 174.29
$attachment "attach_R_shoulderBladeAim" "ValveBiped.Bip01_Spine4" -10.54 -1.39 -5.08 rotate -90.00 -102.85 0.00
$attachment "attach_L_shoulderBladeAim" "ValveBiped.Bip01_Spine4" -10.54 -1.39 3.51 rotate -90.00 -102.85 0.00
$attachment "molotov" "ValveBiped.Bip01_Spine" -3.59 -2.79 7.97 rotate -63.44 -74.67 -101.41
$attachment "grenade" "ValveBiped.Bip01_Spine" -2.29 1.19 8.98 rotate -90.00 -175.23 0.00
$attachment "pills" "ValveBiped.Bip01_Spine" -2.96 0.71 -8.06 rotate -41.18 -88.48 -87.05
$attachment "lfoot" "ValveBiped.Bip01_L_Foot" 0.00 5.00 -0.00 rotate 0.00 0.00 0.00
$attachment "rfoot" "ValveBiped.Bip01_R_Foot" 0.00 5.00 -0.00 rotate -0.00 -0.00 -0.00
$attachment "muzzle_flash" "ValveBiped.Bip01_L_Hand" 0.00 0.00 0.00 rotate 0.00 0.00 0.00
$attachment "survivor_neck" "ValveBiped.Bip01_Neck1" 0.00 -0.00 0.00 rotate -0.00 0.00 -0.00
$attachment "forward" "ValveBiped.forward" 0.00 0.00 0.00 rotate 0.00 -0.00 -0.00
$attachment "bleedout" "ValveBiped.Bip01_Pelvis" 9.50 10.00 5.00 rotate -0.00 0.00 0.00
$attachment "survivor_light" "ValveBiped.Bip01_Spine2" 6.00 24.00 -0.00 rotate 0.00 -0.00 -0.00
$attachment "legL_B" "ValveBiped.attachment_bandage_legL" 0.00 0.00 0.00 rotate -90.00 -90.00 0.00
$attachment "armL_B" "ValveBiped.attachment_bandage_armL" 0.00 0.00 0.00 rotate -90.00 -90.00 0.00
$attachment "armL_T" "ValveBiped.attachment_armL_T" 0.00 0.00 0.00 rotate -90.00 -90.00 0.00
$attachment "armR_T" "ValveBiped.attachment_armR_T" 0.00 0.00 0.00 rotate -90.00 -90.00 0.00
$attachment "armL" "ValveBiped.Bip01_L_Forearm" 0.00 0.00 0.00 rotate -0.00 0.00 0.00
$attachment "legL" "ValveBiped.Bip01_L_Calf" 0.00 0.00 0.00 rotate -0.00 0.00 0.00
$attachment "thighL" "ValveBiped.Bip01_L_Thigh" 0.00 0.00 0.00 rotate -0.00 0.00 0.00
$attachment "spine" "ValveBiped.Bip01_Spine" 0.00 -0.00 0.00 rotate -90.00 -90.00 0.00
$includemodel "survivors/anim_namvet.mdl"
$includemodel "survivors/gestures_namvet.mdl"
$surfaceprop "flesh"
$eyeposition -0.000 0.000 70.000
$illumposition -0.236 -0.077 36.138
$sequence Repo "Repo" fps 30.00
$sequence ragdoll "ragdoll" ACT_DIERAGDOLL 1 fps 30.00
$ikchain rhand ValveBiped.Bip01_R_Hand knee  0.707 0.707 0.000
$ikchain lhand ValveBiped.Bip01_L_Hand knee  0.707 0.707 0.000
$ikchain rfoot ValveBiped.Bip01_R_Foot knee  0.707 -0.707 0.000
$ikchain lfoot ValveBiped.Bip01_L_Foot knee  0.707 -0.707 0.000
$ikchain ikclip ValveBiped.weapon_bone_Clip knee  0.707 -0.707 0.000
$collisionjoints "phymodel.smd" {

   $mass 100.0
   $inertia 10.00
   $damping 0.05
   $rotdamping 5.00
   $rootbone "valvebiped.bip01_pelvis"
   $jointrotdamping "valvebiped.bip01_pelvis" 3.00

   $jointmassbias "valvebiped.bip01_spine1" 8.00
   $jointconstrain "valvebiped.bip01_spine1" x limit -10.00 10.00 0.00
   $jointconstrain "valvebiped.bip01_spine1" y limit -16.00 16.00 0.00
   $jointconstrain "valvebiped.bip01_spine1" z limit -20.00 30.00 0.00

   $jointmassbias "valvebiped.bip01_spine2" 9.00
   $jointconstrain "valvebiped.bip01_spine2" x limit -10.00 10.00 0.00
   $jointconstrain "valvebiped.bip01_spine2" y limit -10.00 10.00 0.00
   $jointconstrain "valvebiped.bip01_spine2" z limit -20.00 20.00 0.00

   $jointmassbias "valvebiped.bip01_r_clavicle" 4.00
   $jointrotdamping "valvebiped.bip01_r_clavicle" 6.00
   $jointconstrain "valvebiped.bip01_r_clavicle" x limit -15.00 15.00 0.00
   $jointconstrain "valvebiped.bip01_r_clavicle" y limit -10.00 10.00 0.00
   $jointconstrain "valvebiped.bip01_r_clavicle" z limit -0.00 45.00 0.00

   $jointmassbias "valvebiped.bip01_l_clavicle" 4.00
   $jointrotdamping "valvebiped.bip01_l_clavicle" 6.00
   $jointconstrain "valvebiped.bip01_l_clavicle" x limit -15.00 15.00 0.00
   $jointconstrain "valvebiped.bip01_l_clavicle" y limit -10.00 10.00 0.00
   $jointconstrain "valvebiped.bip01_l_clavicle" z limit -0.00 45.00 0.00

   $jointmassbias "valvebiped.bip01_l_upperarm" 5.00
   $jointrotdamping "valvebiped.bip01_l_upperarm" 2.00
   $jointconstrain "valvebiped.bip01_l_upperarm" x limit -15.00 20.00 0.00
   $jointconstrain "valvebiped.bip01_l_upperarm" y limit -40.00 32.00 0.00
   $jointconstrain "valvebiped.bip01_l_upperarm" z limit -80.00 25.00 0.00

   $jointmassbias "valvebiped.bip01_l_forearm" 4.00
   $jointrotdamping "valvebiped.bip01_l_forearm" 4.00
   $jointconstrain "valvebiped.bip01_l_forearm" x limit -40.00 15.00 0.00
   $jointconstrain "valvebiped.bip01_l_forearm" y limit 0.00 0.00 0.00
   $jointconstrain "valvebiped.bip01_l_forearm" z limit -120.00 10.00 0.00

   $jointrotdamping "valvebiped.bip01_l_hand" 1.00
   $jointconstrain "valvebiped.bip01_l_hand" x limit -25.00 25.00 0.00
   $jointconstrain "valvebiped.bip01_l_hand" y limit -35.00 35.00 0.00
   $jointconstrain "valvebiped.bip01_l_hand" z limit -50.00 50.00 0.00

   $jointmassbias "valvebiped.bip01_r_upperarm" 5.00
   $jointrotdamping "valvebiped.bip01_r_upperarm" 2.00
   $jointconstrain "valvebiped.bip01_r_upperarm" x limit -15.00 20.00 0.00
   $jointconstrain "valvebiped.bip01_r_upperarm" y limit -40.00 32.00 0.00
   $jointconstrain "valvebiped.bip01_r_upperarm" z limit -80.00 25.00 0.00

   $jointmassbias "valvebiped.bip01_r_forearm" 4.00
   $jointrotdamping "valvebiped.bip01_r_forearm" 4.00
   $jointconstrain "valvebiped.bip01_r_forearm" x limit -40.00 15.00 0.00
   $jointconstrain "valvebiped.bip01_r_forearm" y limit 0.00 0.00 0.00
   $jointconstrain "valvebiped.bip01_r_forearm" z limit -120.00 10.00 0.00

   $jointrotdamping "valvebiped.bip01_r_hand" 1.00
   $jointconstrain "valvebiped.bip01_r_hand" x limit -25.00 25.00 0.00
   $jointconstrain "valvebiped.bip01_r_hand" y limit -35.00 35.00 0.00
   $jointconstrain "valvebiped.bip01_r_hand" z limit -50.00 50.00 0.00

   $jointmassbias "valvebiped.bip01_r_thigh" 7.00
   $jointrotdamping "valvebiped.bip01_r_thigh" 7.00
   $jointconstrain "valvebiped.bip01_r_thigh" x limit -25.00 25.00 0.00
   $jointconstrain "valvebiped.bip01_r_thigh" y limit -10.00 15.00 0.00
   $jointconstrain "valvebiped.bip01_r_thigh" z limit -55.00 25.00 0.00

   $jointmassbias "valvebiped.bip01_r_calf" 4.00
   $jointconstrain "valvebiped.bip01_r_calf" x limit -10.00 25.00 0.00
   $jointconstrain "valvebiped.bip01_r_calf" y limit -5.00 5.00 0.00
   $jointconstrain "valvebiped.bip01_r_calf" z limit -10.00 115.00 0.00

   $jointrotdamping "valvebiped.bip01_r_foot" 2.00
   $jointconstrain "valvebiped.bip01_r_foot" x limit -20.00 30.00 0.00
   $jointconstrain "valvebiped.bip01_r_foot" y limit -30.00 20.00 0.00
   $jointconstrain "valvebiped.bip01_r_foot" z limit -30.00 50.00 0.00

   $jointmassbias "valvebiped.bip01_l_thigh" 7.00
   $jointrotdamping "valvebiped.bip01_l_thigh" 7.00
   $jointconstrain "valvebiped.bip01_l_thigh" x limit -25.00 25.00 0.00
   $jointconstrain "valvebiped.bip01_l_thigh" y limit -10.00 15.00 0.00
   $jointconstrain "valvebiped.bip01_l_thigh" z limit -55.00 25.00 0.00

   $jointmassbias "valvebiped.bip01_l_calf" 4.00
   $jointconstrain "valvebiped.bip01_l_calf" x limit -10.00 25.00 0.00
   $jointconstrain "valvebiped.bip01_l_calf" y limit -5.00 5.00 0.00
   $jointconstrain "valvebiped.bip01_l_calf" z limit -10.00 115.00 0.00

   $jointrotdamping "valvebiped.bip01_l_foot" 2.00
   $jointconstrain "valvebiped.bip01_l_foot" x limit -20.00 30.00 0.00
   $jointconstrain "valvebiped.bip01_l_foot" y limit -30.00 20.00 0.00
   $jointconstrain "valvebiped.bip01_l_foot" z limit -30.00 50.00 0.00

   $jointmassbias "valvebiped.bip01_head1" 4.00
   $jointrotdamping "valvebiped.bip01_head1" 3.00
   $jointconstrain "valvebiped.bip01_head1" x limit -50.00 50.00 0.00
   $jointconstrain "valvebiped.bip01_head1" y limit -20.00 20.00 0.00
   $jointconstrain "valvebiped.bip01_head1" z limit -26.00 30.00 0.00
}
User avatar
Shilo
Smoker
Smoker
 
Posts: 140
Joined: 07 Jun 2009 15:59
Location: Toronto, Ontario, Canada
Title: Legal Assassin
Steam ID: Shilo_Wallace
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby zaigo » 09 Jun 2009 01:29

Nice job with the tutorial, I'm having one minor problem though. I decompiled and recompiled Zoey without changing anything, but her eyes are missing in-game. Should I just fiddle with the eyes attachment?
Visit my blog for all the latest details on my mods.
http://www.rootoverload.org/

Mods:
Ravaged Zoey: Downloads/Skins/Survivors
Protable Minigun: Downloads/Mods/Scripts Plugins
User avatar
zaigo
28 Posts later
28 Posts later
 
Posts: 48
Joined: 08 Jun 2009 21:44

Re: [TUT]Getting Player Models InGame

Postby Shilo » 09 Jun 2009 17:15

hmm wouldn't hurt to try. I'll try to see what I can do with it in a bit as well.
User avatar
Shilo
Smoker
Smoker
 
Posts: 140
Joined: 07 Jun 2009 15:59
Location: Toronto, Ontario, Canada
Title: Legal Assassin
Steam ID: Shilo_Wallace
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby StephanBotha » 10 Jun 2009 01:30

Can you fix the links? remember to use the URL tags around links.
Image
User avatar
StephanBotha
Administrator
Administrator
 
Posts: 882
Joined: 18 Oct 2008 08:31
Location: Dubai, UAE
Steam ID: StephanBotha
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby Shilo » 10 Jun 2009 02:02

Didn't notice that, thanks lol. Fixed.
User avatar
Shilo
Smoker
Smoker
 
Posts: 140
Joined: 07 Jun 2009 15:59
Location: Toronto, Ontario, Canada
Title: Legal Assassin
Steam ID: Shilo_Wallace
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby StephanBotha » 10 Jun 2009 02:55

Hi Shilo!

Thanks for making this tutorial! Can you add some screenshots in the tutorial? If you can do that, I'll add it to the Tutorial list in the main menu. I'm about to recreate the Tutorial list in the Main Menu now with some great tutorials from our community members.
Image
User avatar
StephanBotha
Administrator
Administrator
 
Posts: 882
Joined: 18 Oct 2008 08:31
Location: Dubai, UAE
Steam ID: StephanBotha
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby Shilo » 10 Jun 2009 04:42

Pictures added! I hope these are good enough (and that I didn't add too many lol). I didn't add any for the qc section as it was just easier to write out the code.
User avatar
Shilo
Smoker
Smoker
 
Posts: 140
Joined: 07 Jun 2009 15:59
Location: Toronto, Ontario, Canada
Title: Legal Assassin
Steam ID: Shilo_Wallace
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby StephanBotha » 10 Jun 2009 04:46

No that's perfect! I'll add it to the main menu soon!
Image
User avatar
StephanBotha
Administrator
Administrator
 
Posts: 882
Joined: 18 Oct 2008 08:31
Location: Dubai, UAE
Steam ID: StephanBotha
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby VincentX3 » 10 Jun 2009 08:26

Now if only someone complies Leon Kennedy and maybe something random like Dante (DMC4 Model)
Cant wait for custom models soon :D
Image

Pro Skinner & Texture Artist
User avatar
VincentX3
Survivor
Survivor
 
Posts: 338
Joined: 15 Mar 2009 10:15

Re: [TUT]Getting Player Models InGame

Postby fatdogm » 10 Jun 2009 09:50

sorry if this is a bit of a noob question, but the details on the extracting gcf part seem a little vague so want to make sure im getting this step right,

should I be looking at vpks not gcfs?, most l4d vpks don't seem to display any files in gcfscape, the only one I seem to be able to extract from is pak01_dir.vpk, is this all I need to do or are there other files I need to extract as well?
fatdogm
L4DMods Newbie
L4DMods Newbie
 
Posts: 8
Joined: 28 Nov 2008 14:42

Re: [TUT]Getting Player Models InGame

Postby StephanBotha » 10 Jun 2009 11:33

fatdogm, the pak01_dir is the one you want to extract
Image
User avatar
StephanBotha
Administrator
Administrator
 
Posts: 882
Joined: 18 Oct 2008 08:31
Location: Dubai, UAE
Steam ID: StephanBotha
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby fatdogm » 10 Jun 2009 12:01

thanks, I was expecting that step to be more complicated for some reason :))

i've attempted to follow the tutorial to get a decompiled survivor slightly tweaked back into the game, but run into a couple of issues along the way, any insight into any of these issues would be great

the compiler asked for the ragdoll.smd before it would compile, the tutorial doesn't mention needing this, is this normal

after compiling the models ended up in the hl2 folder not the l4d folder, any idea why this would happen?

when in game the model mesh shows up as expected but using the original materials instead of the edited materials, also the eyes were missing

so partial results, just managed to get into a mess along the way :((
fatdogm
L4DMods Newbie
L4DMods Newbie
 
Posts: 8
Joined: 28 Nov 2008 14:42

Re: [TUT]Getting Player Models InGame

Postby Arctic0ne » 12 Jun 2009 16:15

How do you get the skeleton for the model? When I load the wrinkle it loads up the entire model (I'm a complete noob to XSI, btw).
Also, does this work about the same with weapons as well?

User avatar
Arctic0ne
28 Posts later
28 Posts later
 
Posts: 36
Joined: 05 Dec 2008 21:10
Location: Ohio, United States
Steam ID: Arctic0ne
XBL: Arctic_0ne

Re: [TUT]Getting Player Models InGame

Postby Shilo » 12 Jun 2009 17:04

Yep, it works the same with any model, though for weapons or props, follow the qc's those generate as they will have slightly different settings.

To get just the skeleton, open the smd, and just delete the mesh but leave the bones. I've never used XSI but I assume it is just as easy to do that as it is in 3ds Max.
User avatar
Shilo
Smoker
Smoker
 
Posts: 140
Joined: 07 Jun 2009 15:59
Location: Toronto, Ontario, Canada
Title: Legal Assassin
Steam ID: Shilo_Wallace
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby Arctic0ne » 12 Jun 2009 18:10

OK, the "skeleton" in XSI is just a series of points on the model. Btw, is Francis bigger than everybody else? Because I have to constantly scale all the proportions when I am working with his skeleton. Also, how do you make a .vtf file that will work with your new model?

User avatar
Arctic0ne
28 Posts later
28 Posts later
 
Posts: 36
Joined: 05 Dec 2008 21:10
Location: Ohio, United States
Steam ID: Arctic0ne
XBL: Arctic_0ne

Re: [TUT]Getting Player Models InGame

Postby Shilo » 12 Jun 2009 20:00

Hmm, Francis seems to be the equivalent of a few inches taller than Bill when I open both in max. But otherwise, pretty close in scale. If you are seeing a bigger difference than that.. I don't know, maybe something to do with your smd importer?

For the vtf.. use a tga with the same name as the vtf you will use on the models in the modeling program. It doesn't matter where you save your tga to as the qc should later point to the proper locations.
If you use the vtf plugin for photoshop, DXT5(Common Format) should work well. If you need the plugin, it is here http://developer.valvesoftware.com/wiki/Photoshop_VTF_Plugin
User avatar
Shilo
Smoker
Smoker
 
Posts: 140
Joined: 07 Jun 2009 15:59
Location: Toronto, Ontario, Canada
Title: Legal Assassin
Steam ID: Shilo_Wallace
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby samm5506 » 12 Jun 2009 23:40

If you wan't to, you can go ahead and add a link to all the character models for l4d that I decompiled: http://files.filefront.com/13892589/
samm5506
Smoker
Smoker
 
Posts: 112
Joined: 03 Dec 2008 21:55
Steam ID: 76561197991989781

Re: [TUT]Getting Player Models InGame

Postby Shilo » 12 Jun 2009 23:53

Added, thanks! lol
Probably save some people the trouble of learning how to decompile lol.
User avatar
Shilo
Smoker
Smoker
 
Posts: 140
Joined: 07 Jun 2009 15:59
Location: Toronto, Ontario, Canada
Title: Legal Assassin
Steam ID: Shilo_Wallace
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby StephanBotha » 13 Jun 2009 02:02

Sam, why don't you upload it to L4DMods.com?
Image
User avatar
StephanBotha
Administrator
Administrator
 
Posts: 882
Joined: 18 Oct 2008 08:31
Location: Dubai, UAE
Steam ID: StephanBotha
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby fatdogm » 13 Jun 2009 06:06

any ideas about the issues I posted about?

on the subject of getting the custom materials to show up, should these just work by default or does the vpk need extra editing to stop it from using the default materials
fatdogm
L4DMods Newbie
L4DMods Newbie
 
Posts: 8
Joined: 28 Nov 2008 14:42

Re: [TUT]Getting Player Models InGame

Postby Arctic0ne » 13 Jun 2009 10:41

Shilo wrote:For the vtf.. use a tga with the same name as the vtf you will use on the models in the modeling program. It doesn't matter where you save your tga to as the qc should later point to the proper locations.
If you use the vtf plugin for photoshop, DXT5(Common Format) should work well. If you need the plugin, it is here http://developer.valvesoftware.com/wiki/Photoshop_VTF_Plugin

I understand how to make the .vtf files, but how would I get them to work with my new model? The model is nothing like the original. Just guess and check?
Zoom in (real dimensions: 911 x 779)Image

Also, when I try to compile the model I get this error
ERROR: ikchain 'rhand' too close to root, no parent knee/elbow

User avatar
Arctic0ne
28 Posts later
28 Posts later
 
Posts: 36
Joined: 05 Dec 2008 21:10
Location: Ohio, United States
Steam ID: Arctic0ne
XBL: Arctic_0ne

Re: [TUT]Getting Player Models InGame

Postby Shilo » 13 Jun 2009 16:26

Well, like I said, use a tga with the same name as the vtf you will be using on the model, and then add them to the qc file.

And that error.. if I had to guess, I would say it sounds like it might be missing a bone, did you delete one by mistake maybe?
User avatar
Shilo
Smoker
Smoker
 
Posts: 140
Joined: 07 Jun 2009 15:59
Location: Toronto, Ontario, Canada
Title: Legal Assassin
Steam ID: Shilo_Wallace
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby Arctic0ne » 13 Jun 2009 17:34

OK, i think I understand.
I think I figured it out. For some reason when I exported the SMD it was all screwed up, I had that nice model, and now all that is there is a head. Are their any special way I was suppose to export it?

User avatar
Arctic0ne
28 Posts later
28 Posts later
 
Posts: 36
Joined: 05 Dec 2008 21:10
Location: Ohio, United States
Steam ID: Arctic0ne
XBL: Arctic_0ne

Re: [TUT]Getting Player Models InGame

Postby Shilo » 13 Jun 2009 17:47

From what I'm reading, that is an XSI only error... one person said
"you should check the "Remove top-level bone of the Character Rig"". I assume that is an export or import option for smd in XSI?

They also said "the way i export the models is with "Optimize Chains and Compensate" & "Remove Top-Level Bone on Character Rig" checked, file type: Model (.SMD) as it should be."

They also talked about all kinds of rotation problems exporting with XSI.
User avatar
Shilo
Smoker
Smoker
 
Posts: 140
Joined: 07 Jun 2009 15:59
Location: Toronto, Ontario, Canada
Title: Legal Assassin
Steam ID: Shilo_Wallace
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby Arctic0ne » 13 Jun 2009 18:03

YES! When using XSI you have to UNCHECK "Remove all unused Bones" this generates the file with nothing on it. Meaning that the new mesh you put over the skeleton isn't connected to the bones, so it deletes your new mesh :D
Yea, well this did create a model, Francis is now invisible, save for his arms, because that was the only original part of his body left. Hmm, what modeling program are you using? Because it seems to work.
Last edited by Arctic0ne on 13 Jun 2009 18:12, edited 1 time in total.

User avatar
Arctic0ne
28 Posts later
28 Posts later
 
Posts: 36
Joined: 05 Dec 2008 21:10
Location: Ohio, United States
Steam ID: Arctic0ne
XBL: Arctic_0ne

Re: [TUT]Getting Player Models InGame

Postby Shilo » 13 Jun 2009 18:07

So you got it working then? lol
User avatar
Shilo
Smoker
Smoker
 
Posts: 140
Joined: 07 Jun 2009 15:59
Location: Toronto, Ontario, Canada
Title: Legal Assassin
Steam ID: Shilo_Wallace
Favourite Survivor: Zoey
 

Re: [TUT]Getting Player Models InGame

Postby jorgeluvshispie » 13 Jun 2009 19:17

Sweetness. Now someone can remake the original (beta) survivor models!
User avatar
jorgeluvshispie
Hunter
Hunter
 
Posts: 59
Joined: 01 Mar 2009 18:38

Re: [TUT]Getting Player Models InGame

Postby Shilo » 13 Jun 2009 19:57

Arctic0ne wrote:Hmm, what modeling program are you using? Because it seems to work.


I'm using 3ds max 5, I'm most comfortable with max and I got this copy in school lol.
User avatar
Shilo
Smoker
Smoker
 
Posts: 140
Joined: 07 Jun 2009 15:59
Location: Toronto, Ontario, Canada
Title: Legal Assassin
Steam ID: Shilo_Wallace
Favourite Survivor: Zoey
 

Next

Return to Resources

Who is online

Users browsing this forum: MSNbot Media, Shilo and 1 guest

In total there are 3 users online :: 2 registered, 0 hidden and 1 guest (based on users active over the past 60 minutes)
Most users ever online was 1910 on 05 Oct 2009 11:28

Users browsing this forum: MSNbot Media, Shilo and 1 guest