Player Model Creation?

Hey everyone, I’ve searched everywhere for a detailed explanation on “how 2 player model”, but I’m at a point where I’m kind of lost.
I succesfully decompiled a skin I took from CSS, now I’m at the editing the .qc part. Can someone help me because I have no idea what to do, I would really appreciate it.

So I want to make it a wearable playermodel–
Here’s the content of the .qc file


$cd "C:\Users\xxx\Desktop\Divii's Section 8 Captain PlayerModel"
$modelname "diviis8\diviis8.mdl"
$model "ref" "x.smd"
$poseparameter move_yaw -180.00 180.00
$poseparameter body_pitch -90.00 90.00
$poseparameter body_yaw -90.00 90.00
$cdmaterials "models\player\fixed\s8\"
$hboxset "cstrike"
$hbox 3 "ValveBiped.Bip01_Pelvis" -8.300  -1.870  -6.010  8.300  7.870  6.010
$hbox 6 "ValveBiped.Bip01_L_Thigh" 0.850  -4.580  -3.000  19.150  4.580  5.000
$hbox 6 "ValveBiped.Bip01_L_Calf" -0.290  -2.720  -2.930  20.880  4.720  3.930
$hbox 6 "ValveBiped.Bip01_L_Foot" -2.290  -2.860  -2.290  5.720  2.860  2.290
$hbox 6 "ValveBiped.Bip01_L_Toe0" -2.860  -3.000  -2.290  4.000  1.000  2.290
$hbox 7 "ValveBiped.Bip01_R_Thigh" 0.850  -4.580  -5.000  19.150  4.580  3.000
$hbox 7 "ValveBiped.Bip01_R_Calf" -0.290  -2.720  -3.930  20.880  4.720  2.930
$hbox 7 "ValveBiped.Bip01_R_Foot" -2.290  -2.860  -2.290  5.720  2.860  2.290
$hbox 7 "ValveBiped.Bip01_R_Toe0" -2.860  -3.000  -2.290  4.000  1.000  2.290
$hbox 3 "ValveBiped.Bip01_Spine1" -5.860  -3.290  -8.010  7.860  9.290  8.010
$hbox 2 "ValveBiped.Bip01_Spine2" -1.320  -4.870  -9.690  15.320  8.870  9.690
$hbox 1 "ValveBiped.Bip01_Neck1" -0.810  -3.430  -2.860  4.810  3.430  2.860
$hbox 1 "ValveBiped.Bip01_Head1" -2.890  -6.540  -3.330  6.890  4.140  3.330
$hbox 4 "ValveBiped.Bip01_L_UpperArm" -1.140  -2.580  -2.290  14.870  2.580  2.290
$hbox 4 "ValveBiped.Bip01_L_Forearm" -1.720  -2.400  -2.400  13.160  2.400  2.400
$hbox 4 "ValveBiped.Bip01_L_Hand" 0.290  -2.010  -1.590  6.580  2.010  2.990
$hbox 5 "ValveBiped.Bip01_R_UpperArm" -1.140  -2.580  -2.290  14.870  2.580  2.290
$hbox 5 "ValveBiped.Bip01_R_Forearm" -1.720  -2.400  -2.400  13.160  2.400  2.400
$hbox 5 "ValveBiped.Bip01_R_Hand" 0.290  -2.010  -2.990  6.580  2.010  1.590
// Model uses material "slow_body.vmt"
// Model uses material "slow_gold.vmt"
// Model uses material "slow_head.vmt"
// Model uses material "slow_body_shader.vmt"
// Model uses material "slow_head_shader.vmt"
// Model uses material "slow_gold_shader.vmt"
$attachment "forward" "ValveBiped.forward" 0.00 0.00 0.00 rotate 0.00 0.00 -0.00
$attachment "grenade0" "ValveBiped.Bip01_Pelvis" 7.45 4.24 -3.33 rotate -13.05 173.19 92.40
$attachment "grenade1" "ValveBiped.Bip01_Pelvis" 2.13 4.48 -6.15 rotate -81.11 178.93 91.12
$attachment "grenade2" "ValveBiped.Bip01_Pelvis" -7.50 3.33 2.16 rotate 22.39 2.47 -86.84
$attachment "grenade3" "ValveBiped.Bip01_Pelvis" -6.29 4.44 -4.03 rotate -33.00 -3.00 -88.00
$attachment "pistol" "ValveBiped.Bip01_R_Thigh" 3.90 5.00 -7.80 rotate -8.00 -2.00 95.00
$attachment "primary" "ValveBiped.Bip01_Spine2" 13.03 -9.00 -7.48 rotate -17.00 177.00 -4.00
$attachment "eholster" "ValveBiped.Bip01_L_Thigh" 6.15 -0.56 7.50 rotate 4.00 -92.00 90.00
$attachment "c4" "ValveBiped.Bip01_Spine2" 13.67 -9.55 0.95 rotate -29.00 65.00 22.00
$attachment "lfoot" "ValveBiped.Bip01_L_Foot" -0.00 5.20 0.00 rotate -0.00 0.00 -0.00
$attachment "rfoot" "ValveBiped.Bip01_R_Foot" 0.00 5.20 -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 "defusekit" "ValveBiped.Bip01_Pelvis" 0.00 1.22 -6.66 rotate -73.06 90.93 179.75
$includemodel "player/cs_player_shared.mdl"
$includemodel "player/ak_anims_ct.mdl"
$includemodel "player/ak_anims_t.mdl"
$surfaceprop "metal"
$eyeposition -0.000 0.000 150.000
$illumposition -0.016 -2.014 36.781
$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 40.0
	$inertia 10.00
	$damping 0.01
	$rotdamping 1.50
	$rootbone "valvebiped.bip01_pelvis"

	$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 20.00 0.00

	$jointconstrain "valvebiped.bip01_spine2" x limit -15.00 15.00 0.00
	$jointconstrain "valvebiped.bip01_spine2" y limit -15.00 15.00 0.00
	$jointconstrain "valvebiped.bip01_spine2" z limit -25.00 20.00 0.00

	$jointconstrain "valvebiped.bip01_r_clavicle" x limit -10.00 10.00 0.00
	$jointconstrain "valvebiped.bip01_r_clavicle" y limit -10.00 10.00 0.00
	$jointconstrain "valvebiped.bip01_r_clavicle" z limit -10.00 45.00 0.00

	$jointconstrain "valvebiped.bip01_l_clavicle" x limit -10.00 10.00 0.00
	$jointconstrain "valvebiped.bip01_l_clavicle" y limit -10.00 10.00 0.00
	$jointconstrain "valvebiped.bip01_l_clavicle" z limit -10.00 45.00 0.00

	$jointconstrain "valvebiped.bip01_l_upperarm" x limit -40.00 40.00 0.00
	$jointconstrain "valvebiped.bip01_l_upperarm" y limit -35.00 130.00 0.00
	$jointconstrain "valvebiped.bip01_l_upperarm" z limit -110.00 30.00 0.00

	$jointconstrain "valvebiped.bip01_l_forearm" x limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_l_forearm" y limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_l_forearm" z limit -145.00 5.00 0.00

	$jointconstrain "valvebiped.bip01_l_hand" x limit -37.00 37.00 0.00
	$jointconstrain "valvebiped.bip01_l_hand" y limit -45.00 45.00 0.00
	$jointconstrain "valvebiped.bip01_l_hand" z limit -57.00 59.00 0.00

	$jointconstrain "valvebiped.bip01_r_upperarm" x limit -40.00 40.00 0.00
	$jointconstrain "valvebiped.bip01_r_upperarm" y limit -130.00 35.00 0.00
	$jointconstrain "valvebiped.bip01_r_upperarm" z limit -110.00 30.00 0.00

	$jointconstrain "valvebiped.bip01_r_forearm" x limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_r_forearm" y limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_r_forearm" z limit -145.00 5.00 0.00

	$jointconstrain "valvebiped.bip01_r_hand" x limit -60.00 60.00 0.00
	$jointconstrain "valvebiped.bip01_r_hand" y limit -45.00 45.00 0.00
	$jointconstrain "valvebiped.bip01_r_hand" z limit -57.00 70.00 0.00

	$jointconstrain "valvebiped.bip01_r_thigh" x limit -20.00 20.00 0.00
	$jointconstrain "valvebiped.bip01_r_thigh" y limit -15.00 45.00 0.00
	$jointconstrain "valvebiped.bip01_r_thigh" z limit -100.00 50.00 0.00

	$jointconstrain "valvebiped.bip01_r_calf" x limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_r_calf" y limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_r_calf" z limit 0.00 115.00 0.00

	$jointconstrain "valvebiped.bip01_r_foot" x limit -10.00 10.00 0.00
	$jointconstrain "valvebiped.bip01_r_foot" y limit -25.00 25.00 0.00
	$jointconstrain "valvebiped.bip01_r_foot" z limit -15.00 35.00 0.00

	$jointinertia "valvebiped.bip01_r_toe0" 100.00
	$jointdamping "valvebiped.bip01_r_toe0" 25.00
	$jointrotdamping "valvebiped.bip01_r_toe0" 25.00
	$jointconstrain "valvebiped.bip01_r_toe0" x limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_r_toe0" y limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_r_toe0" z limit -35.00 25.00 0.00

	$jointconstrain "valvebiped.bip01_l_thigh" x limit -20.00 20.00 0.00
	$jointconstrain "valvebiped.bip01_l_thigh" y limit -45.00 15.00 0.00
	$jointconstrain "valvebiped.bip01_l_thigh" z limit -100.00 50.00 0.00

	$jointconstrain "valvebiped.bip01_l_calf" x limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_l_calf" y limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_l_calf" z limit 0.00 115.00 0.00

	$jointconstrain "valvebiped.bip01_l_foot" x limit -10.00 10.00 0.00
	$jointconstrain "valvebiped.bip01_l_foot" y limit -25.00 25.00 0.00
	$jointconstrain "valvebiped.bip01_l_foot" z limit -15.00 35.00 0.00

	$jointconstrain "valvebiped.bip01_l_toe0" x limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_l_toe0" y limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_l_toe0" z limit -35.00 25.00 0.00

	$jointconstrain "valvebiped.bip01_head1" x limit -30.00 30.00 0.00
	$jointconstrain "valvebiped.bip01_head1" y limit -25.00 25.00 0.00
	$jointconstrain "valvebiped.bip01_head1" z limit -37.00 20.00 0.00
}


I’ve seen some people say you that you need to add this for NPC making


$includemodel "humans/male_shared.mdl"  
$includemodel "humans/male_ss.mdl"  
$includemodel "humans/male_gestures.mdl"  
$includemodel "humans/male_postures.mdl"


And most importantly this for player model


$includemodel "m_anm.mdl"  
$includemodel "m_gst.mdl"  
$includemodel "m_pst.mdl"  
$includemodel "m_shd.mdl"  
$includemodel "m_ss.mdl"  


If this is the case, can you tell me how to put that in?
Thank you in advance :slight_smile:

GMod wiki has example player models ( Sources for kleiner, alyx, some more ), it should be enough to figure it all out.

Okay thank you, I guess I’ll go with the try-error way, but now I need to recompile the files but the ones I got are outdated because of steam pipe, do you per chance have a link to a recompiler?

Use TF2s studiomdl.exe, I use it myself.

Later you only must create the lua file that include your player model

[lua]
$sequence ragdoll “ragdoll” ACT_DIERAGDOLL -1 fps 30.00

$includemodel “humans/male_shared.mdl”
$includemodel “humans/male_ss.mdl”
$includemodel “humans/male_gestures.mdl”
$includemodel “humans/male_postures.mdl”
$includemodel “m_anm.mdl”
$includemodel “m_gst.mdl”
$includemodel “m_pst.mdl”
$includemodel “m_shd.mdl”
$includemodel “m_ss.mdl”

$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
[/lua]

Do you have by chance a link where I can download it? I tried searching it but got no luck :l

Studiomdl.exe are in:

Steam\SteamApps\common\Team fortress 2\bin\studiomdl.exe

But you must create a batch file for compile it (Because just draging the qc file here couldn’t work)

Aw I don’t have TF2 installed >.<
Guess I’ll need to install it, I only have 13GB left on my computer though :stuck_out_tongue:

Anyway thanks a lot gonzalo and Robotboy!

check on other source games folder if you have studio mdl, excluding games like l4d2, portal 2, csgo and sfm, i’m not really sure if they will compile a model compatable

You’re right! I found one in css, so how does it work exactly?

I would like to have a batch files here, but i don’t, try to search about how to compile a qc with studiomdl,


"C:/FULL/PATH/TO/studiomdl.exe" -game "C:/FULL/PATH/TO/garrysmod/garrysmod/" -nop4 -nox360 %1
pause

Here’s what I use. You can just drag’n’drop a .qc onto the .bat file or double click on the .qc, select a program on PC > Browse > select the .bat > profit. Now you can just double click your .qc to compile the model.

Thank you again Robotboy, now I got to see that there was an error:

I don’t really know what is causing this, does any of you could help me?

Btw I’d be very happy if you guys would add me in steam, make things easier; IGN: Divii or pwningcs

“Couldn’t load file x.smd”
That file exists?

Yeah it was part of the de-compilation of the main .mdl I’m trying to make a playermodel of
along with those, who’re all part of the decompilation of the .mdl

Okay I fixed it and succesfully compiled it! Thanks again, but now there’s another problem. In Gmod this is what I get, first the model is at a different angle than it’s supposed to be, second there is no animation :frowning: How can I fix that?

and

Are examples :l

Is the model on a VALVe skeleton?

Yes I think, well I took it from gamebanana css

There are some player model sources, make sure your QC looks rougly/almost as one of those in the sources.

Okay will do, btw what Gonzalo said earlier, did I have to add it in my .qc file? And do you want me to post my .qc file?