Help with turning ragdoll to playermodel

I was wondering if anyone would help me with this .qc file for a ragdoll. I have tried to find other examples for this one little line, but I have not found anything like it. I was also wondering what other things need to be done with it. Keep in mind that I have never done this in my life before and plan to have this server owner use this on their server.

Here’s the file:

$cd "-:\----\----\---------\---------------"
$modelname "GFSA\reno360Armor1.mdl"
$model "studio" "StealthArmor.smd"
$cdmaterials "models\EPIX\Reno360SAskn\"
$hboxset "default"
$hbox 0 "Bip01 Head" -2.895  -4.591  -3.793  9.180  5.694  3.793
$hbox 0 "Bip01 Neck1" -2.886  -4.827  -5.129  4.637  4.021  5.129
$hbox 0 "Bip01 Pelvis" -9.312  -5.083  -7.313  8.500  6.417  7.313
$hbox 0 "Bip01 L Thigh" -2.743  -5.022  -3.871  23.524  5.805  5.298
$hbox 0 "Bip01 L Calf" -2.888  -4.034  -2.938  17.024  3.393  2.928
$hbox 0 "Bip01 L Foot" -2.300  -2.598  -2.147  3.816  8.115  2.409
$hbox 0 "Bip01 L Toe0" -5.655  -0.366  -2.147  1.237  4.042  2.321
$hbox 0 "Bip01 R Thigh" -2.743  -5.022  -5.298  23.524  5.805  3.871
$hbox 0 "Bip01 R Calf" -2.888  -4.034  -2.928  17.024  3.393  2.938
$hbox 0 "Bip01 R Foot" -2.300  -2.598  -2.409  3.816  8.115  2.147
$hbox 0 "Bip01 R Toe0" -5.655  -0.366  -2.321  1.237  4.042  2.147
$hbox 0 "Bip01 Spine" -4.430  -7.037  -6.947  12.218  5.540  6.947
$hbox 0 "Bip01 Spine1" -5.394  -7.678  -7.680  12.087  5.423  7.681
$hbox 0 "Bip01 Spine2" -5.472  -6.717  -9.452  14.478  5.693  9.452
$hbox 0 "Bip01 L Clavicle" -1.974  -5.007  -6.320  10.491  6.163  5.465
$hbox 0 "Bip01 L UpperArm" -0.564  -3.142  -2.735  12.427  3.133  3.106
$hbox 0 "Bip01 L Forearm" -3.499  -2.823  -2.514  10.619  2.354  2.159
$hbox 0 "Bip01 L Hand" -0.684  -2.012  -3.173  6.098  2.103  1.953
$hbox 0 "Bip01 L Thumb1" -0.423  -1.060  -0.725  4.214  2.934  2.746
$hbox 0 "Bip01 L Thumb11" -0.535  -0.757  -0.604  2.228  0.841  1.309
$hbox 0 "Bip01 L Thumb12" -0.866  -0.678  -0.500  1.397  0.391  0.575
$hbox 0 "Bip01 L Finger1" -1.354  -0.762  -1.005  2.801  1.060  0.973
$hbox 0 "Bip01 L Finger11" -0.790  -0.528  -0.555  1.611  0.677  0.524
$hbox 0 "Bip01 L Finger2" -0.469  -0.550  -1.172  2.628  1.229  1.100
$hbox 0 "Bip01 L Finger3" -0.472  -0.672  -1.120  3.031  1.063  1.521
$hbox 0 "Bip01 L Finger31" -0.219  -0.505  -0.772  1.674  0.589  0.481
$hbox 0 "Bip01 L Finger4" -1.081  -0.517  -0.959  2.144  1.102  0.675
$hbox 0 "Bip01 L Finger41" -0.588  -0.512  -0.679  1.267  0.642  0.529
$hbox 0 "Bip01 L ForeTwist" 0.000  -2.615  -2.009  13.383  2.051  2.195
$hbox 0 "Bip01 LUpArmTwistBone" -3.483  -3.986  -3.718  10.454  3.253  3.318
$hbox 0 "Bip01 R Clavicle" -2.078  -5.007  -5.467  10.491  6.400  6.320
$hbox 0 "Bip01 R UpperArm" 0.000  -3.142  -3.105  12.427  3.133  2.735
$hbox 0 "Bip01 R Forearm" -2.884  -2.823  -2.159  10.619  2.354  2.514
$hbox 0 "Bip01 R ForeTwist" 0.000  -2.561  -2.213  13.363  2.107  1.989
$hbox 0 "Bip01 R Hand" -0.671  -1.988  -1.953  6.098  2.102  3.155
$hbox 0 "Bip01 R Thumb1" -0.405  -1.069  -2.740  4.213  2.934  0.726
$hbox 0 "Bip01 R Thumb11" -0.535  -0.757  -1.309  2.229  0.841  0.604
$hbox 0 "Bip01 R Thumb12" -0.866  -0.678  -0.575  1.397  0.391  0.500
$hbox 0 "Bip01 R Finger1" -1.354  -0.762  -0.974  2.801  1.060  1.005
$hbox 0 "Bip01 R Finger11" -0.790  -0.528  -0.524  1.611  0.677  0.555
$hbox 0 "Bip01 R Finger2" -0.469  -0.550  -1.101  2.628  1.229  1.171
$hbox 0 "Bip01 R Finger3" -0.472  -0.672  -1.521  3.051  1.063  1.094
$hbox 0 "Bip01 R Finger31" -0.219  -0.505  -0.481  1.673  0.589  0.772
$hbox 0 "Bip01 R Finger4" -1.081  -0.517  -0.675  2.144  1.102  0.958
$hbox 0 "Bip01 R Finger41" -0.583  -0.495  -0.529  1.265  0.634  0.679
$hbox 0 "Bip01 RUpArmTwistBone" -4.047  -3.965  -3.266  9.891  3.274  3.770
// Model uses material "ChineseStealthArmor.vmt"
// Model uses material "ChineseStealthArmorGloves.vmt"
// Model uses material "Bronze_e.vmt"
// Model uses material "ChineseStealthArmorMale.vmt"
$includemodel "m_anm.mdl"
$includemodel "m_gst.mdl"
$includemodel "m_pst.mdl"
$includemodel "m_shd.mdl"
$includemodel "m_ss.mdl"
$surfaceprop "metal"
$illumposition -2.420 0.850 33.726
$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"
	$jointrotdamping "valvebiped.bip01_pelvis" 3.00
	$jointconstrain "bip01 spine" x limit -46.00 46.00 0.00
	$jointconstrain "bip01 spine" y limit -36.00 35.00 0.00
	$jointconstrain "bip01 spine" z limit -28.00 86.00 0.00

	$jointconstrain "bip01 spine1" x limit -44.00 44.00 0.00
	$jointconstrain "bip01 spine1" y limit -32.00 32.00 0.00
	$jointconstrain "bip01 spine1" z limit -41.00 43.00 0.00

	$jointconstrain "bip01 spine2" x limit -50.00 50.00 0.00
	$jointconstrain "bip01 spine2" y limit -39.00 39.00 0.00
	$jointconstrain "bip01 spine2" z limit -46.00 66.00 0.00

	$jointconstrain "bip01 r clavicle" x limit 0.00 0.00 0.00
	$jointconstrain "bip01 r clavicle" y limit -19.00 44.00 0.00
	$jointconstrain "bip01 r clavicle" z limit -24.00 37.00 0.00

	$jointconstrain "bip01 l clavicle" x limit 0.00 0.00 0.00
	$jointconstrain "bip01 l clavicle" y limit -48.00 26.00 0.00
	$jointconstrain "bip01 l clavicle" z limit -39.00 32.00 0.00

	$jointconstrain "bip01 l upperarm" x limit -70.00 93.00 0.00
	$jointconstrain "bip01 l upperarm" y limit -77.00 70.00 0.00
	$jointconstrain "bip01 l upperarm" z limit -108.00 61.00 0.00

	$jointconstrain "bip01 l forearm" x limit 0.00 0.00 0.00
	$jointconstrain "bip01 l forearm" y limit 0.00 0.00 0.00
	$jointconstrain "bip01 l forearm" z limit -122.00 0.00 0.00

	$jointconstrain "bip01 l hand" x limit -86.00 67.00 0.00
	$jointconstrain "bip01 l hand" y limit -48.00 66.00 0.00
	$jointconstrain "bip01 l hand" z limit -57.00 66.00 0.00

	$jointconstrain "bip01 r upperarm" x limit -77.00 104.00 0.00
	$jointconstrain "bip01 r upperarm" y limit -66.00 66.00 0.00
	$jointconstrain "bip01 r upperarm" z limit -109.00 57.00 0.00

	$jointconstrain "bip01 r forearm" x limit 0.00 0.00 0.00
	$jointconstrain "bip01 r forearm" y limit 0.00 0.00 0.00
	$jointconstrain "bip01 r forearm" z limit -126.00 0.00 0.00

	$jointconstrain "bip01 r hand" x limit -79.00 68.00 0.00
	$jointconstrain "bip01 r hand" y limit -35.00 35.00 0.00
	$jointconstrain "bip01 r hand" z limit -59.00 57.00 0.00

	$jointconstrain "bip01 r thigh" x limit -70.00 44.00 0.00
	$jointconstrain "bip01 r thigh" y limit -68.00 23.00 0.00
	$jointconstrain "bip01 r thigh" z limit -66.00 113.00 0.00

	$jointconstrain "bip01 r calf" x limit 0.00 0.00 0.00
	$jointconstrain "bip01 r calf" y limit 0.00 0.00 0.00
	$jointconstrain "bip01 r calf" z limit -108.00 0.00 0.00

	$jointconstrain "bip01 head" x limit -57.00 57.00 0.00
	$jointconstrain "bip01 head" y limit -53.00 53.00 0.00
	$jointconstrain "bip01 head" z limit -61.00 50.00 0.00

	$jointconstrain "bip01 l thigh" x limit -50.00 44.00 0.00
	$jointconstrain "bip01 l thigh" y limit -28.00 64.00 0.00
	$jointconstrain "bip01 l thigh" z limit -82.00 106.00 0.00

	$jointconstrain "bip01 l calf" x limit 0.00 0.00 0.00
	$jointconstrain "bip01 l calf" y limit 0.00 0.00 0.00
	$jointconstrain "bip01 l calf" z limit -113.00 0.00 0.00

	$jointconstrain "bip01 l foot" x limit -64.00 55.00 0.00
	$jointconstrain "bip01 l foot" y limit -15.00 10.00 0.00
	$jointconstrain "bip01 l foot" z limit -79.00 53.00 0.00

	$jointconstrain "bip01 r foot" x limit -64.00 70.00 0.00
	$jointconstrain "bip01 r foot" y limit -15.00 17.00 0.00
	$jointconstrain "bip01 r foot" z limit -57.00 41.00 0.00

The lines that I need help with are the spine parts that have no number, so, for example,

$jointconstrain "bip01 spine" x limit -46.00 46.00 0.00

What would I do with this line?
Another is the lines including clavicle in them, I have no idea what to change that to.
Do I also need to take out the $cd line before I compile this?

Thanks for the help!

Assuming this is a player model for Garry’s Mod, personally, I find the easiest way is to re-rig it to a decompiled player model bone structure, and simply recompile. Though I understand this might not be ideal for you, only having the ragdoll, it may not be possible without adding extra bones or re-rigging, otherwise, due to the requirements of some extra bones I believe.

For the player model to work with the default animations, it’s required that the bones have the same names, which in this case look like: valvebiped.bip01_head1 etc.

I’m not entirely sure it’s possible to just turn a ragdoll into a playermodel unless it’s already on the valve biped.

I was thinking about doing that, but the only problem I thought I’d find was that things would be misplaced, or look weird. Is it possible for me to just rename these bones to match the valve ones? And if I do re-rig it, can I leave some of the lines in the code that were already there? Like:
$mass 60.0
$inertia 10.00
$damping 0.01
$rotdamping 1.50

The reason there are some of the valve bone names is because I already started editing this, I just got super stuck when I saw that there was three spine bone names. Like I said, I had no idea what number to set the first spine bone to.

Well, the bones are matched with those of the animations, so that’s the main reason things tend to look misplaced/weird. You can leave the lines of code to do with mass etc, because when a player dies, it uses the same model as it’s player model for the ragdoll. If there are too many bones compared to what the model has, you can just remove that line, say, if there’s a third spine bone, and your model only has 2 spine bones, remove the one that isn’t included on the model.

Renaming them would most likely lead to fucked up player models, due to the placement of bones, though I suppose there is the odd occurrence it could work with a decent outcome, there’s still the matter of the extra bones required by Gmod, for example, the physgun attachment, so make sure you add those in.

Ok, I might as well try both. Or if I’m happy with the first result, I’ll just keep that one. If I’m just going to re-rig it to another player model, does it matter that there be similar qualities, like for example the numbers after the bones?

Just curious, do I need to use Ep1 when compiling these on GUIStudioMDL? Because I don’t have a gameconfig for the bin/ep1/bin. Would this be a problem?

You know, there is a workshop addon I believe is called Model Manipulator, where you can set your playermodel to anything thats a ragdoll

To walk you through on how I do it, I just decompile a player model from Gmod, most of the time I’m working on female models, so I just do Alyx, then import them into 3DS, delete the mesh, and rig as normal. To compile, I just use the original QC from what I just decompiled, change the paths and compile again. I just go to ep1/bin and drag the QC over studiomdl, never had a reason to use GUIStudioMDL or anything. I have no idea what to do if there’s a problem with the gameconfig, but I’m sure a quick search on google can help you.

There’s no reason to replace any models or anything, so don’t worry about similar qualities. The numbers after bones have to be the same, because it has to match up to the original valve biped.

If you think I’m missing anything out, just let me know, I’m kinda tired atm.

Ok, I looked at them, they seemed alright and could work for what I’m trying to accomplish. Only, the problem is that the Model Manipulators aren’t permanent I do believe. Plus, I was wanting this for a server, so I don’t know how well that would work.

Another question, what are some of the other animations that I should include? This is a sort of ninja by the way. It is also this:

[editline]5th January 2013[/editline]

Sorry, I’ll try to be quick with the rest of this.

What is the full name of the software?

And by the original valve biped, do you mean the model I’m using to re-rig “my model”, or model I’m using’s valve biped numbers?

Alright, I’ll try answer what I can.

  1. When you decompile a model for the rig + QC, it’ll have the included animations in the QC. Those are all you need.
  2. I’m not sure what software you mean.
  3. By the original valve biped, I mean the bone structure of the decompiled player model you’re using to recompile. The bones you’re going to rig your custom model to. (Labelled valvebiped.etc)

I think I know what you meant by 3DS, 3ds Max. Which, thankfully, I can get for free from Autodesk for being a student.

I think you cleared up everything. If anything else comes up, I’ll play around with it to see if I can solve it myself.

Thanks for all your help voltlight!

You’re welcome.

The only tools you’ll need is GCFScape, SMD Importer and SMD Exporter.

I know I’ll probably be thought as stupid for not having it, but does and of the compiling tools out there like GUIStudioMDL or StudioCompiler need HL2 to run correctly?
3DS Max won’t download for me and I have no money to buy HL2. I also don’t have any friends that make models to have them compile it for me, nor do I have any money to have someone make a whole new model/player model for me.

Or does anyone know any other way to compile a .qc file?
A list of programs would be much appreciated.
I have already downloaded GUIStudioMDL, and StudioCompiler.

I also have this error:
MountFilesystem( 443 ) failed: SteamMountFilesystem(1748,443,0x1ef7fcc0=,0x1ef7fbb0) failed with error 116: Cache needs repair
I get this when I try to compile using GUIStudioMDL and when using several applications within the SourceSDK launcher(Hammer, View Model).
When I try to compile using StudioCompiler, it gives me an error saying:
Command /studiomdl.exe not found.
Please set correct HL2 SDK path using configure button.
And when I use the configure button, navigate to my SDK tools in the bin/ep1/bin folder and press select, the StudioCompiler just becomes unresponsive and would eventually tell me to close the program.

I never knew it would be so hard to try and get a ragdoll to be a player model on the Gmod server I play on.

Oh, yeah, I think you’d definitely need HL2, or at least one of them. If you give me the files, I can compile it for you if you want.

That would be awesome! What 's the best way for me to get it to you? And what are all the files needed, the .qc file I know, but what about the original .smd files that were decompiled as well?

Hopefully I re-rigged the .qc file correctly as well!

Just PM me a zip containing the phymodel.smd, ragdoll.smd, reference.smd and the QC. (The reference.smd is the new rig you just did)

Sorry for the delayed response, but I can’t seem to find the attachment button/function. I could also upload it to Mediafire or something.

I also seem to have the feeling I misunderstood what you meant by re-rig. The only thing I thought you meant was to get another decompiled playermodel’s .qc file and take everything that doesn’t directly relate to bone structure from the the original .qc and paste in the respective spots in the other decompiled playermodel’s .qc. I still have the original .qc file and .smd files.

This is the main thing I am confused about:

The decompiled model has a phymodel.smd, a ragdoll.smd, a StealthArmor.smd, and of course the .qc. I was thinknig the reference.smd would be the StealthArmor.smd, but seeing as though you said the “new rig” I’m now thinking it has to be something that would’ve needed to have been made. The only problem is, I have no idea what to use. :confused:

Once again, thanks for all your help and patience with me.

people please click on my link so I can hack my friends Facebook for a awesome prank, need 15 visitors

Heh, no, no, by rigging, I’m talking entirely about the work in 3DS Max. You need that ninja model rigged to the valve biped. Then, you save that rigged model as reference.smd, and that’s what I need with the rest of the stuff. You don’t need to touch the QC, just going to use the one from the original Gmod player model.

More problems I see now. I’m using MilkShape(don’t ask how xD) as my modeling program, since 3DS Max won’t even download for some reason. It can still import .smd files though. I’m also finding that this is still way more challenging than I originally thought, as I have no idea how to rig it using a modelling software let alone model anything at all except for in Autodesk Inventor. The best thing I could come up with is a reference.smd where I imported all original .smd files into MilkShape and literally renamed all the Biped things to have the “ValveBiped.” prefix to them. I just really don’t know what you mean :confused:

Anyway, here is the link to a zip file that includes a non-modified .qc file, phymodel.smd, ragdoll.smd, StealthArmor.smd, and the most-likely-a-fail-reference.smd.

Also, if you wanted to make chatting easier instead of posting these, my steam name is “The Mighty Boosh” with no quotations and with spaces.

It needs to be properly rigged.