compiled player model problem

I’m trying to recompile some Korin models into player models.

I decompiled it, added player animations to the qc file, then recompiled it.
Then I made it an addon. When I load gmod, the ragdoll of the Korin model
spawns from the browse tab just fine. When I select her as a player model
then kill myself to change into her, I get a big red error sign.

Here is the qc (the only thing I changed before compiling was the “$includemodel” stuff,
lines 85-100) which I copied/pasted from a decompiled Korin that was already a player model):



[lua]$cd "C:\Program Files\Steam\SteamApps\imoutosan\half-life 2\hl2\models\Humans\Group03"
$modelname "Humans/Group03/KorinGant.mdl"
$model "Female_06" "korin.smd" {
     flexfile "mdldecompiler_expressions.vta" {
          flex "upper_left" frame 4
          flex "lower_left" frame 6
     }
     eyeball righteye ValveBiped.Bip01_Head1 -1.350 -2.660 65.290 eyeball_r 1.400  -1.000 pupil_r 0.800
     eyeball lefteye ValveBiped.Bip01_Head1 1.350 -2.660 65.290 eyeball_l 1.400  1.000 pupil_l 0.800
      eyelid  upper_right "mdldecompiler_expressions.vta" lowerer 1 -0.500000 neutral 0 0.000000 raiser 1070596096 0.000000 split 0.1 eyeball righteye
      eyelid  lower_right "mdldecompiler_expressions.vta" lowerer 2 -0.500000 neutral 0 0.000000 raiser 1070596096 0.000000  split 0.1 eyeball righteye
      eyelid  upper_left "mdldecompiler_expressions.vta" lowerer 4 -0.500000 neutral 0 0.000000 raiser 1070596096 0.000000 split -0.1 eyeball lefteye
      eyelid  lower_left "mdldecompiler_expressions.vta" lowerer 6 -0.500000 neutral 0 0.000000 raiser 1070596096 0.000000  split -0.1 eyeball lefteye
     flexcontroller head head_rightleft "range" -30.000 30.000
     flexcontroller head head_updown "range" -15.000 15.000
     flexcontroller head head_tilt "range" -15.000 15.000
     flexcontroller eyes eyes_updown "range" -15.000 15.000
     flexcontroller eyes eyes_rightleft "range" -30.000 30.000
     flexcontroller body body_rightleft "range" -30.000 30.000
     flexcontroller chest chest_rightleft "range" -30.000 30.000
     flexcontroller head head_forwardback "range" -0.200 0.200
     flexcontroller gesture gesture_updown "range" -1.000 1.000
     flexcontroller gesture gesture_rightleft "range" -1.000 1.000
}
$lod 20
 {
  replacemodel "korin" "lod1_korin"
}
$lod 60
 {
  replacemodel "korin" "lod2_korin"
}
$shadowlod
{
  replacemodel "korin" "lod3_korin"
}
$cdmaterials "models\player\kogan\"
$cdmaterials "models\Humans\Female\"
$hboxset "default"
$hbox 0 "ValveBiped.Bip01_Pelvis" -6.923  -6.218  -5.520  6.923  9.012  3.861
$hbox 0 "ValveBiped.Bip01_L_Thigh" -4.672  -3.771  -4.809  19.964  5.475  3.078
$hbox 0 "ValveBiped.Bip01_L_Calf" -2.453  -9.168  -3.193  22.095  2.857  3.126
$hbox 0 "ValveBiped.Bip01_L_Foot" -0.939  -2.170  -1.826  9.782  4.300  2.169
$hbox 0 "ValveBiped.Bip01_L_Toe0" -1.475  -2.019  -1.810  3.357  1.361  2.183
$hbox 0 "ValveBiped.Bip01_R_Thigh" -4.672  -3.771  -3.077  19.964  5.475  4.809
$hbox 0 "ValveBiped.Bip01_R_Calf" -2.453  -9.168  -3.126  22.095  2.857  3.193
$hbox 0 "ValveBiped.Bip01_R_Foot" -0.940  -2.146  -2.188  9.783  4.302  1.820
$hbox 0 "ValveBiped.Bip01_R_Toe0" -1.486  -1.997  -2.134  3.348  1.494  1.911
$hbox 0 "ValveBiped.Bip01_Spine" -5.101  -2.456  -6.167  7.771  5.645  6.167
$hbox 0 "ValveBiped.Bip01_Spine1" -4.566  -2.371  -5.664  7.813  6.514  5.664
$hbox 0 "ValveBiped.Bip01_Spine2" -11.367  -2.870  -6.293  20.852  7.089  6.293
$hbox 0 "ValveBiped.Bip01_Spine4" -1.397  -2.288  -4.586  6.379  5.578  4.586
$hbox 0 "ValveBiped.Bip01_Neck1" -2.538  -3.926  -3.873  3.286  2.142  3.873
$hbox 0 "ValveBiped.Bip01_Head1" -3.300  -4.838  -4.244  7.775  4.246  4.267
$hbox 0 "ValveBiped.Bip01_L_Clavicle" -1.496  -5.071  -4.199  8.875  4.898  2.830
$hbox 0 "ValveBiped.Bip01_L_UpperArm" -1.512  -2.486  -3.343  11.920  2.839  2.460
$hbox 0 "ValveBiped.Bip01_L_Forearm" -0.425  -2.225  -1.463  17.591  1.878  1.683
$hbox 0 "ValveBiped.Bip01_L_Hand" -0.575  -1.058  -1.567  4.562  1.006  1.513
$hbox 0 "ValveBiped.Bip01_L_Finger2" 0.000  -0.667  -1.581  2.038  0.584  0.405
$hbox 0 "ValveBiped.Bip01_L_Finger21" -0.265  -0.847  -1.334  1.344  0.245  0.405
$hbox 0 "ValveBiped.Bip01_L_Finger0" 0.000  -0.204  -0.867  1.659  0.921  0.764
$hbox 0 "ValveBiped.Bip01_L_Finger01" -0.179  -0.248  -0.621  1.241  0.932  0.764
$hbox 0 "ValveBiped.Bip01_R_Clavicle" -0.583  -5.324  -2.943  8.875  4.865  4.020
$hbox 0 "ValveBiped.Bip01_R_UpperArm" -1.512  -2.486  -2.460  11.920  2.839  3.343
$hbox 0 "ValveBiped.Bip01_R_Forearm" -0.425  -2.225  -1.683  17.591  1.878  1.463
$hbox 0 "ValveBiped.Bip01_R_Hand" -0.575  -1.059  -1.510  4.562  1.006  1.569
$hbox 0 "ValveBiped.Bip01_R_Finger2" 0.000  -0.658  -0.404  2.038  0.584  1.583
$hbox 0 "ValveBiped.Bip01_R_Finger21" -0.272  -0.839  -0.404  1.344  0.244  1.338
$hbox 0 "ValveBiped.Bip01_R_Finger0" 0.000  -0.201  -0.760  1.659  0.927  0.867
$hbox 0 "ValveBiped.Bip01_R_Finger01" -0.181  -0.241  -0.760  1.238  0.937  0.626
$hbox 0 "ValveBiped.Bip01_L_Bust" 0.000  -2.337  -3.755  6.585  3.494  2.075
$hbox 0 "ValveBiped.Bip01_R_Bust" 0.000  -2.337  -2.075  6.585  3.494  3.275
// Model uses material "eyeball_l.vmt"
// Model uses material "eyeball_r.vmt"
// Model uses material "korin01C.vmt"
// Model uses material "but.vmt"
// Model uses material "hairC4.vmt"
// Model uses material "hairC.vmt"
// Model uses material "hairC2.vmt"
// Model uses material "hairC3.vmt"
// Model uses material "pupil_r.vmt"
// Model uses material "glint.vmt"
// Model uses material "pupil_l.vmt"
$attachment "eyes" "ValveBiped.Bip01_Head1" 2.76 -3.05 -0.00 rotate 0.00 -80.10 -90.00
$includemodel "alyx_animations.mdl"
$includemodel "alyx_postures.mdl"
$includemodel "alyx_gestures.mdl"
$includemodel "humans/female_shared.mdl"
$includemodel "humans/female_gestures.mdl"
$includemodel "humans/female_shared.mdl"
$includemodel "humans/female_postures.mdl"
$includemodel "humans/female_ss.mdl"
$includemodel "player/female_anims.mdl"
$includemodel "player/f_anm.mdl"
$includemodel "player/f_gst.mdl"
$includemodel "player/f_pst.mdl"
$includemodel "player/f_shd.mdl"
$includemodel "player/f_ss.mdl"
$includemodel "player/cs_fix.mdl"
$includemodel "player/global_include.mdl"
$surfaceprop "flesh"
$eyeposition -0.000 0.000 70.000
$illumposition 2.744 -0.148 33.707
$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
$collisionjoints "phymodel.smd" {

	$mass 60.0
	$inertia 10.00
	$damping 0.01
	$rotdamping 1.50
	$rootbone "valvebiped.bip01_pelvis"

	$jointconstrain "valvebiped.bip01_spine1" x limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_spine1" y limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_spine1" z limit 0.00 0.00 0.00

	$jointconstrain "valvebiped.bip01_spine2" x limit -48.00 48.00 0.20
	$jointconstrain "valvebiped.bip01_spine2" y limit -25.00 25.00 0.20
	$jointconstrain "valvebiped.bip01_spine2" z limit -25.00 50.00 0.20

	$jointconstrain "valvebiped.bip01_r_upperarm" x limit -30.00 30.00 0.00
	$jointconstrain "valvebiped.bip01_r_upperarm" y limit -90.00 90.00 0.00
	$jointconstrain "valvebiped.bip01_r_upperarm" z limit -90.00 25.00 0.00

	$jointconstrain "valvebiped.bip01_r_forearm" x limit 0.00 0.00 0.20
	$jointconstrain "valvebiped.bip01_r_forearm" y limit 0.00 0.00 0.20
	$jointconstrain "valvebiped.bip01_r_forearm" z limit -149.00 4.00 0.20

	$jointconstrain "valvebiped.bip01_l_upperarm" x limit -30.00 30.00 0.20
	$jointconstrain "valvebiped.bip01_l_upperarm" y limit -90.00 90.00 0.20
	$jointconstrain "valvebiped.bip01_l_upperarm" z limit -90.00 25.00 0.20

	$jointconstrain "valvebiped.bip01_l_forearm" x limit 0.00 0.00 0.20
	$jointconstrain "valvebiped.bip01_l_forearm" y limit 0.00 0.00 0.20
	$jointconstrain "valvebiped.bip01_l_forearm" z limit -149.00 4.00 0.20

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

	$jointconstrain "valvebiped.bip01_head1" x limit -20.00 20.00 0.20
	$jointconstrain "valvebiped.bip01_head1" y limit -25.00 25.00 0.20
	$jointconstrain "valvebiped.bip01_head1" z limit -30.00 30.00 0.20

	$jointmassbias "valvebiped.bip01_r_bust" 0.40
	$jointinertia "valvebiped.bip01_r_bust" 5.00
	$jointrotdamping "valvebiped.bip01_r_bust" 5.00
	$jointconstrain "valvebiped.bip01_r_bust" x limit -15.00 15.00 0.00
	$jointconstrain "valvebiped.bip01_r_bust" y limit -15.00 15.00 0.00
	$jointconstrain "valvebiped.bip01_r_bust" z limit -15.00 15.00 0.00

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

	$jointconstrain "valvebiped.bip01_r_thigh" x limit -10.00 10.00 0.20
	$jointconstrain "valvebiped.bip01_r_thigh" y limit -30.00 70.00 0.20
	$jointconstrain "valvebiped.bip01_r_thigh" z limit -90.00 30.00 0.20

	$jointconstrain "valvebiped.bip01_r_calf" x limit 0.00 0.00 0.20
	$jointconstrain "valvebiped.bip01_r_calf" y limit 0.00 0.00 0.20
	$jointconstrain "valvebiped.bip01_r_calf" z limit -12.00 126.00 0.20

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

	$jointconstrain "valvebiped.bip01_l_thigh" x limit -10.00 10.00 0.20
	$jointconstrain "valvebiped.bip01_l_thigh" y limit -70.00 30.00 0.20
	$jointconstrain "valvebiped.bip01_l_thigh" z limit -90.00 30.00 0.20

	$jointconstrain "valvebiped.bip01_l_calf" x limit 0.00 0.00 0.20
	$jointconstrain "valvebiped.bip01_l_calf" y limit 0.00 0.00 0.20
	$jointconstrain "valvebiped.bip01_l_calf" z limit -12.00 126.00 0.20

	$jointconstrain "valvebiped.bip01_l_foot" x limit 0.00 0.00 0.00
	$jointconstrain "valvebiped.bip01_l_foot" y limit -19.00 19.00 0.20
	$jointconstrain "valvebiped.bip01_l_foot" z limit -15.00 35.00 0.20

	$jointmassbias "valvebiped.bip01_l_bust" 0.40
	$jointinertia "valvebiped.bip01_l_bust" 5.00
	$jointrotdamping "valvebiped.bip01_l_bust" 5.00
	$jointconstrain "valvebiped.bip01_l_bust" x limit -15.00 15.00 0.00
	$jointconstrain "valvebiped.bip01_l_bust" y limit -15.00 15.00 0.00
	$jointconstrain "valvebiped.bip01_l_bust" z limit -15.00 15.00 0.00
}
[/lua]


I didn’t change any file paths (that i’m aware of), or any filenames. I also
(being new to decompiling/compiling) may have not done something else
I needed to do, so I may have missed steps in the process. I hope I have
been descriptive/informational, and help is much appreciated.

If it spawns fine as a ragdoll its nothing to do with the qc. Show me your lua file to define the models as playermodels in the list, as it sounds like your paths are wrong.

lua/autorun:


[lua]if (SERVER) then
	player_manager.AddValidModel( "Korin Gantz", "models\Humans\Group03\KorinGant.mdl" ) 	
		AddCSLuaFile( "Korin_models_players.lua" )
end

list.Set( "PlayerOptionsModel",  "Korin Gantz", "models\Humans\Group03\KorinGant.mdl" )
[/lua]

After another look at your qc (as I can’t actually see it in the post I have to look in a reply as [lua] code doesn’t show for me for some reason), you have waaaaaaay to many $includemodel 's all you need is

$includemodel “alyx_animations.mdl”
$includemodel “alyx_postures.mdl”
$includemodel “alyx_gestures.mdl”
$includemodel “humans/female_shared.mdl”

for alyx animations for an npc

$includemodel “humans/female_shared.mdl”
$includemodel “humans/female_gestures.mdl”
$includemodel “humans/female_postures.mdl”
$includemodel “humans/female_ss.mdl”

for a citizen npc

$includemodel “f_anm.mdl”
$includemodel “f_gst.mdl”
$includemodel “f_pst.mdl”
$includemodel “f_shd.mdl”

for a female player model

$includemodel “cs_fix.mdl”

for a male CS:S model

$includemodel “global_include.mdl”

This isn’t actually in any of the base GMod player models, but i put it in anyway. And I don’t know where people have got this thing of puting “player” in the path of all the anims because its incorrect.

Edit: Weird I can see the code in the quote @.@ also I forgot to finish (whoops)

So all you need is:

$includemodel “alyx_animations.mdl”
$includemodel “alyx_postures.mdl”
$includemodel “alyx_gestures.mdl”
$includemodel “humans/female_shared.mdl”
$includemodel “f_anm.mdl”
$includemodel “f_gst.mdl”
$includemodel “f_pst.mdl”
$includemodel “f_shd.mdl”
$includemodel “global_include.mdl”

for an alyx npc and female playermodel ready character.

So I just need:

$includemodel “f_anm.mdl”
$includemodel “f_gst.mdl”
$includemodel “f_pst.mdl”
$includemodel “f_shd.mdl”

And maybe this? :

$includemodel “global_include.mdl”

The player model I decompiled to copy the animation’s had all this:

$includemodel “alyx_animations.mdl”
$includemodel “alyx_postures.mdl”
$includemodel “alyx_gestures.mdl”
$includemodel “humans/female_shared.mdl”
$includemodel “humans/female_gestures.mdl”
$includemodel “humans/female_shared.mdl”
$includemodel “humans/female_postures.mdl”
$includemodel “humans/female_ss.mdl”
$includemodel “player/female_anims.mdl”
$includemodel “player/f_anm.mdl”
$includemodel “player/f_gst.mdl”
$includemodel “player/f_pst.mdl”
$includemodel “player/f_shd.mdl”
$includemodel “player/f_ss.mdl”
$includemodel “player/cs_fix.mdl”
$includemodel “player/global_include.mdl”

This is the korin I decompiled for the $includemodel stuff I copied btw:

i’m very suprised it works as a playermodel with all that (maybe alyx has some of the female player anims, i’ve not been able to check, but it would explain it).

But yes thats all you really need.

Edit: try removing the capital letters in the model name in your lua file, i’ve had things get buggered up because models generally only have small letters (even if ou put capitals in the qc) and it needs to be correct case sensitively for spawnlists and lua (from my experience).


if (SERVER) then
	player_manager.AddValidModel( "Korin Gantz", "models\Humans\Group03\koringant.mdl" ) 	
		AddCSLuaFile( "Korin_models_players.lua" )
end

list.Set( "PlayerOptionsModel",  "Korin Gantz", "models\Humans\Group03\koringant.mdl" )


Try that.

I got the original compile to work, even with all the $includemodels you said I had WAAAAAAAAY too much of.
I just took it out of addon format, and put it directly into the main gmod folder.

Thank you very much for all your help Silver Spirit! Much appreciated.

Screen as proof: