|
|
Creating Ragdoll Models Difficulty: Advanced |
| Category: CS:S > Modeling | Author(s): |

The following tutorial shows how to create a ragdoll model. These models are for more than just characters. The famous mattress model is a ragdoll model. If you want parts of a model to swing or move separately from the rest then you should use a ragdoll model. To use a ragdoll model you use prop_ragdoll instead of prop_static or prop_dynamic.
To create a ragdoll model you must create one with separate bones for each part of the model which will move. Here is an example of a simple ragdoll model in milkshape.

Ragdoll.gif
Create a reference smd file from milkshape or your favorite editing tool.
If you were going to just compile this model as a static prop you would use the following .qc file
$modelname "mymodels/myragdoll.mdl"
$scale 1.0
$cd ""
$body "Body" myragdoll.smd
$cdmaterials "models\mymodelmaterials"
$staticprop
// 1 sequence
$sequence idle "myragdoll" fps 5 ACT_IDLE 1
$surfaceprop "wood"
$keyvalues { "prop_data" {"base" "wooden.large" }
$cdmaterials "models\mymodels"
$collisionmodel "myragdoll.smd" {
// Mass in kilograms
$concave
$mass 500.0
}
To change this to a ragdoll model you change the $collisionmodel to $collisionjoints and specify how the joints can rotate with respect to the root joint. An example .qc is as follows
$modelname "mymodels/myragdoll.mdl"
$scale 1.0
$cd ""
$body "Body" myragdoll.smd
$cdmaterials "models\mymodelmaterials"
//$staticprop
// 1 sequence
$sequence idle "myragdoll" fps 5 ACT_IDLE 1
$surfaceprop "wood"
$keyvalues { "prop_data" {"base" "wooden.large" }
$cdmaterials "models\mymodels"
$collisionjoints "myragdoll_ragdoll.smd" {
// Mass in kilograms
$rootbone "joint1"
$concave
$mass 80.0
$inertia 5.00
$damping 0.01
$rotdamping 1.50
$jointconstrain joint1 x limit 0.000000 0.000000 0.000000
$jointconstrain joint1 y limit 0.000000 0.000000 0.000000
$jointconstrain joint1 z limit 0.000000 0.000000 0.000000
$jointconstrain joint2 x limit -90.000000 90.000000 1.000000
$jointconstrain joint2 y limit -90.000000 90.000000 1.000000
$jointconstrain joint2 z limit -45.000000 45.000000 1.000000
$jointconstrain joint3 x limit -90.000000 90.000000 1.000000
$jointconstrain joint3 y limit -90.000000 90.000000 1.000000
$jointconstrain joint3 z limit -45.000000 45.000000 1.000000
}
Each of the jointconstrain commands control the joint rotation in a specific axis. For example the above .qc allows joint2 and joint3 to rotate +/- 90 degrees in the x and y and +/- 45 degrees in the z (up/down) axis.
In the above example I used boxes for each of the joints, so I don't need to create a separate ragdoll collision model. If your model is more complicated, then for the collision model you should create a new .smd with one box assigned to each joint. The box will be used for collisions for that joint and the size will determine the weight of the joint.
Tutorial by WikiPedia, brought to CSB by [Xero]. |
| Added: 3 years ago | Tags: creating, ragdoll, models |
 Add Feedback Provide constructive feedback. What is "constructive"?You cannot post yet!Get involved on FPSB by posting your thoughts. Give authors your feedback to help them develop. To post in this submission register or login. |
 You cannot assess yet!Moderating FPSB is in your hands - when you assess a submission your vote determines its success or failure. To vote on this submission register or login. This Tutorial in a nutshell... Confusing 1 x Confusing You cannot stamp yet!Stamps let you apply characteristics to submissions to help others understand them. To stamp this submission register or login. None found ::Admin Bananite Want more? Find related tuts. |