Issues With Adding New Animations / Recompiling male_shared

I’m working on a mod with a friend, and I’ve taken my crack at adding custom animations. I decompiled male_shared.mdl with the intentions of adding new animations for the mod; and did do with success. I can view the animations in model viewer & Hammer without any issues (the animations work fine)

However, in-game this happens.

(backwards, crossed legs)

I’ve Googled to no avail, and I can’t find the source of the issue. Here’s the .qc file I’ve been trying to compile with:

If it helps, I used this to decompile the model, and I used the following .bat file to compile:

"%sourcesdk%/bin/orangebox/bin/studiomdl" -nop4 %1pause

I used 3dsMax to create the animations; this doesn’t really matter because even if I don’t add/change any animations, the model *still *won’t compile corrected (backwards + crossed leg issue in the image above still happens). I’ve also looked at the files provided with source sdk (a handful of the npc_citizen files located in steamnamehere/sourcesdk_content/hl2/modelsrc/humans/sdk/), and they weren’t really helpful (the .qc I linked above is completely different from the one they provide you)

If anyone can help me here, I’d really appreciate it. I’ve spent two weeks trying to figure this out. While Googling around, the only real help that I found that it may be a issue with the bones of the model (I can’t find the thread anymore, but it was on interlopers, and it was really scarce with the details). Again, any help is really appreciated.

It looks like, in my opinion, something to do with the IK chains, try deleting the lines in the QC that reference them and see if it makes a difference.

I tried deleting the following lines you mentioned:

$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

Recompiled, and there’s no difference. Thanks for the attempt, though.

If it helps, it looks like the npc is also floating slightly above the ground, and his lower body seems to move with his torso.


So I took a look at the male_shared_XSI_sdk.qci file in sourcesdk_content\hl2\modelsrc\Male_Animations_sdk\ and found these lines:

$heirarchy "valvebiped.Bip01_L_Clavicle" "valvebiped.Bip01_Spine4" $heirarchy "valvebiped.Bip01_R_Clavicle" "valvebiped.Bip01_Spine4" 
$heirarchy "ValveBiped.Bip01_L_Thigh" "valvebiped.Bip01_Pelvis" 
$heirarchy "valvebiped.Bip01_R_Thigh" "valvebiped.Bip01_Pelvis"

I figured that the Pelvis bone must not be connected to the legs (which would make a lot of sense actually), but upon compiling I got an error:

ERROR: unknown bone: "ValveBiped.Bip01_L_Thigh" in forced hierarchy
ERROR: Aborted Processing on 'Humans\male_shared.mdl'

Any ideas?


Scratch this. Now it compiles (even though I didn’t change anything), but there’s no change.


Holy shit I got it working!

I compiled the model using male_shared_XSI_sdk.qci file in sourcesdk_content\hl2\modelsrc\Male_Animations_sdk\ to see if it would work, and it did.

Initially the origin of the animations or something was screwed up. Copy pasting animations from the other male_shared caused the cross-legs bug, so it’s not a bone issue, it’s an animation issue.

AFAIK no one has ever got this working so I’ll make more posts as I go along. It would still really help if anyone found out why the first issue is happening in the first place.

Bumping, I’ve been working off the SDK’s male_shared, I still don’t really understand why the decompiled/recompiled male_shared had these issues.

Would appreciate it if someone could help!

It’s most likely that the animations become corrupted in the decompile process, it wouldn’t be the first time this has happened.

If I were you, I’d hex the original male shared and make a new one where hexed original is included in.

It doesn’t seem like that, as they play back in model viewer & hammer just fine; they only don’t work in game.

[editline]12th May 2012[/editline]

I would make my own shared animation file, but then I’d have to recompile all the models (male01, male02, male03, so on) to use a .qc command called $includemodel, otherwise they can’t use them.

dude -- Dude --

Here you go

use these

in male_postures.qc add yo shiz

// Custom anims go first

$sequence cj_massive_hit_back "cj_massive_hit_back" snap fps 30.00

$sequence cj_massive_flying_back "cj_massive_flying_back" loop fps 30.00


oh yeah let me quote Maxofs2d

Oh wow, I feel like a complete idiot now. Thanks, going to try this out and see if it works better.

[editline]13th May 2012[/editline]

You’re awesome! It works.

I’m seriously forever in your debt.