Wazanator

Source Engine ragdoll example QC

Feb 25th, 2015
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.88 KB | None | 0 0
  1. //////////////////////////////////////////////////////////////////////////////////////////////////////
  2. //Source: http://facepunch.com/showthread.php?t=1156389&p=34281851&viewfull=1#post34281851////////////
  3. //////////////////////////////////////////////////////////////////////////////////////////////////////
  4. //where is the file source dir
  5. $cd "H:\My scribbles\!3d_projects\harlequins\male"
  6.  
  7. //where tocompile to
  8. $modelname "Harlequins\male.mdl"
  9.  
  10. //reference smd
  11. $model "male01" "resizedbones" {
  12. }
  13.  
  14. //path to textuers
  15. $cdmaterials "models\harlequins\male1"
  16.  
  17.  
  18. //attachments - not important if you have no faceposing or are using valve animations - can be ignored
  19. $attachment "eyes" "ValveBiped.Bip01_Head1" 3.67 -4.32 0.00 rotate 0.00 -80.10 -90.00
  20. $attachment "mouth" "ValveBiped.Bip01_Head1" 1.00 -6.50 -0.00 rotate 0.00 -80.00 -90.00
  21. $attachment "chest" "ValveBiped.Bip01_Spine2" 5.00 4.00 -0.00 rotate -0.00 90.00 90.00
  22. $attachment "forward" "ValveBiped.forward" 0.00 0.00 0.00 rotate 0.00 0.00 -0.00
  23. $attachment "anim_attachment_RH" "ValveBiped.Anim_Attachment_RH" -0.00 -0.00 -0.00 rotate -90.00 -90.00 0.00
  24. $attachment "anim_attachment_LH" "ValveBiped.Anim_Attachment_LH" -0.00 -0.00 0.00 rotate -90.00 -90.00 0.00
  25. $attachment "anim_attachment_head" "ValveBiped.Bip01_Head1" -0.00 0.00 0.00 rotate -90.00 -90.00 0.00
  26.  
  27. //a sequence - has to be at least one
  28. $sequence ragdoll "resizedbones" ACT_DIERAGDOLL 1 fps 30.00
  29.  
  30. //included animations - only usefull if you are using an existing skeleton
  31. $includemodel "humans/male_shared.mdl"
  32. $includemodel "humans/male_ss.mdl"
  33. $includemodel "humans/male_gestures.mdl"
  34. $includemodel "humans/male_postures.mdl"
  35.  
  36. //what materials is the models made off
  37. $surfaceprop "flesh"
  38. $eyeposition 0.000 0.000 70.000
  39.  
  40. //the center of illumination
  41. $illumposition 0.654 0.000 36.127
  42.  
  43. //ikchains - important for some animations
  44. $ikchain rhand ValveBiped.Bip01_R_Hand knee  0.707 0.707 0.000
  45. $ikchain lhand ValveBiped.Bip01_L_Hand knee  0.707 0.707 0.000
  46. $ikchain rfoot ValveBiped.Bip01_R_Foot knee  0.707 -0.707 0.000
  47. $ikchain lfoot ValveBiped.Bip01_L_Foot knee  0.707 -0.707 0.000
  48.  
  49. //colisionjoints - how much each ragdoll part stretches
  50. $collisionjoints "phymodel.smd" {
  51.  
  52.     $mass 90.0
  53.     $inertia 10.00
  54.     $damping 0.01
  55.     $rotdamping 1.50
  56. //the first bone in the model
  57.     $rootbone "valvebiped.bip01_pelvis"
  58.     $jointmerge "ValveBiped.Bip01_Pelvis" "ValveBiped.Bip01_Spine1"
  59.  
  60. //the actual ragdoll rotation constraints. You will make those in HLMV
  61.     $jointconstrain "valvebiped.bip01_spine2" x limit -70.00 70.00 0.00
  62.     $jointconstrain "valvebiped.bip01_spine2" y limit -25.00 25.00 0.00
  63.     $jointconstrain "valvebiped.bip01_spine2" z limit -65.00 95.00 0.00
  64.  
  65.     $jointconstrain "valvebiped.bip01_l_upperarm" x limit -40.00 40.00 0.00
  66.     $jointconstrain "valvebiped.bip01_l_upperarm" y limit -115.00 150.00 0.00
  67.     $jointconstrain "valvebiped.bip01_l_upperarm" z limit -135.00 135.00 0.00
  68.  
  69.     $jointconstrain "valvebiped.bip01_l_forearm" x limit -30.00 30.00 0.00
  70.     $jointconstrain "valvebiped.bip01_l_forearm" y limit -60.00 60.00 0.00
  71.     $jointconstrain "valvebiped.bip01_l_forearm" z limit -140.00 30.00 0.00
  72.  
  73.     $jointconstrain "valvebiped.bip01_r_upperarm" x limit -40.00 40.00 0.00
  74.     $jointconstrain "valvebiped.bip01_r_upperarm" y limit -150.00 115.00 0.00
  75.     $jointconstrain "valvebiped.bip01_r_upperarm" z limit -135.00 135.00 0.00
  76.  
  77.     $jointconstrain "valvebiped.bip01_r_forearm" x limit -30.00 30.00 0.00
  78.     $jointconstrain "valvebiped.bip01_r_forearm" y limit -60.00 60.00 0.00
  79.     $jointconstrain "valvebiped.bip01_r_forearm" z limit -140.00 30.00 0.00
  80.  
  81.     $jointconstrain "valvebiped.bip01_r_hand" x limit -60.00 60.00 0.00
  82.     $jointconstrain "valvebiped.bip01_r_hand" y limit -60.00 60.00 0.00
  83.     $jointconstrain "valvebiped.bip01_r_hand" z limit -70.00 70.00 0.00
  84.  
  85.     $jointconstrain "valvebiped.bip01_l_hand" x limit -60.00 60.00 0.00
  86.     $jointconstrain "valvebiped.bip01_l_hand" y limit -60.00 60.00 0.00
  87.     $jointconstrain "valvebiped.bip01_l_hand" z limit -70.00 70.00 0.00
  88.  
  89.     $jointconstrain "valvebiped.bip01_r_thigh" x limit -40.00 40.00 0.00
  90.     $jointconstrain "valvebiped.bip01_r_thigh" y limit -90.00 55.00 0.00
  91.     $jointconstrain "valvebiped.bip01_r_thigh" z limit -110.00 125.00 0.00
  92.  
  93.     $jointconstrain "valvebiped.bip01_r_calf" x limit -30.00 30.00 0.00
  94.     $jointconstrain "valvebiped.bip01_r_calf" y limit -12.00 12.00 0.00
  95.     $jointconstrain "valvebiped.bip01_r_calf" z limit -12.00 145.00 0.00
  96.  
  97.     $jointconstrain "valvebiped.bip01_head1" x limit -70.00 70.00 0.00
  98.     $jointconstrain "valvebiped.bip01_head1" y limit -25.00 25.00 0.00
  99.     $jointconstrain "valvebiped.bip01_head1" z limit -65.00 40.00 0.00
  100.  
  101.     $jointconstrain "valvebiped.bip01_l_thigh" x limit -40.00 40.00 0.00
  102.     $jointconstrain "valvebiped.bip01_l_thigh" y limit -55.00 90.00 0.00
  103.     $jointconstrain "valvebiped.bip01_l_thigh" z limit -110.00 120.00 0.00
  104.    
  105.     $jointconstrain "valvebiped.bip01_l_calf" x limit -30.00 30.00 0.00
  106.     $jointconstrain "valvebiped.bip01_l_calf" y limit -12.00 12.00 0.00
  107.     $jointconstrain "valvebiped.bip01_l_calf" z limit -12.00 145.00 0.00
  108.  
  109.     $jointconstrain "valvebiped.bip01_l_foot" x limit -40.00 40.00 0.00
  110.     $jointconstrain "valvebiped.bip01_l_foot" y limit -40.00 40.00 0.00
  111.     $jointconstrain "valvebiped.bip01_l_foot" z limit -55.00 35.00 0.00
  112.  
  113.     $jointconstrain "valvebiped.bip01_r_foot" x limit -40.00 40.00 0.00
  114.     $jointconstrain "valvebiped.bip01_r_foot" y limit -40.00 40.00 0.00
  115.     $jointconstrain "valvebiped.bip01_r_foot" z limit -55.00 35.00 0.00
  116.    
  117.     $jointconstrain "valvebiped.bip01_l_toe0" x limit 0.00 0.00 0.00
  118.     $jointconstrain "valvebiped.bip01_l_toe0" y limit 0.00 0.00 0.00
  119.     $jointconstrain "valvebiped.bip01_l_toe0" z limit -46.00 46.00 0.00
  120.    
  121.     $jointconstrain "valvebiped.bip01_r_toe0" x limit 0.00 0.00 0.00
  122.     $jointconstrain "valvebiped.bip01_r_toe0" y limit 0.00 0.00 0.00
  123.     $jointconstrain "valvebiped.bip01_r_toe0" z limit -46.00 46.00 0.00
  124.     $animatedfriction 1.000 400.000 0.500 0.300 0.000
  125. }
Advertisement
Add Comment
Please, Sign In to add comment