Garry's Mod

Garry's Mod

3
   
Award
Favorite
Favorited
Unfavorite
Caption
"functional but unconverted sfm models in gmod in a nutshell..."
9 Comments
LeftyGemsMagpie 23 May, 2020 @ 12:23am 
(continued)

You write joint constrains for each of the bones that are rigged to one of the many physics shell you created, so you repeat those 3 lines for each bone

anyway it seems a lot to take in but I've explained the basics of a physics model that's required to turn SFM stuff into useable ragdolls.

https://developer.valvesoftware.com/wiki/$collisionjoints

more information on source developer wiki

and this is creating a collision mesh
https://developer.valvesoftware.com/wiki/Collision_mesh
LeftyGemsMagpie 23 May, 2020 @ 12:19am 
(continued)
Anyway, to the qc file I don't really pay attention to the first few values (barring $rootbone, it 's the name for the very base bone of the model that moves all the other bones which is different for many models) but the $jointconstrain ones are important. They dictate how a joint bends. The XYZ values tend to vary quite a bit (to be technical, it's dependent on how a joint is pivoted) so it's best to look at Half-Life Model Viewer, which you can set up if you use Crowbar, under the physics tab. Anyway the X limit for my Mario would be lifting his head, Y is tilting his head, and Z is turning is head. But they may not be the same for these characters. These limits have a min-max value, so Mario can actually rotate his head one direction farther than the other for the X direction.

Oh and "Head" refers to the bone name. So if your character's head bone is called like "Bip01_Head" instead you use that name or else the compiler won't work and will say "can't find bone".
LeftyGemsMagpie 23 May, 2020 @ 12:19am 
(continued)
the "mario_surfing_physics.smd" would be the name of the physics model. The physics model itself is like a bunch of simple models (rectangular prisms, spheres, cones, etc) that represent each piece of a model you can pick up with a physgun.

I don't know if you know how you rig but you put that physics model on top of the bones of the original model, and you rig each prism, sphere, cone, etc of that model to a single bone, with maxiumum bone weight.

So if you want to give a ragdoll a useable head, make a low-poly sphere (as an example), put it where the character's head is, fit the shape of the head, then rig all that sphere to the head bone.

you don't need to give every bone a physics model. But the most common joints you manipulate are head, spine, upper leg, lower leg, foot, toe, shoulder/clavicle, upper arm, forearm, and hand and so you make separate polygons for each of those joints and then you rig all polygons to the corresponding joints.
LeftyGemsMagpie 23 May, 2020 @ 12:19am 
Yeah they likely have spawned with a green circle and stuff. You can likely to pose them with the Advanced Bone Tool or any dedicated tool that manipulates bones; this is because they're already rigged and usable for SFM.

However you need to include a line in the qc file to give your model ragdoll physics. an excerpt below (a part of the collision I used for the Mario in the image you saw)


$collisionjoints "mario_surfing_physics.smd"
{
$mass 60
$inertia 10
$damping 0.01
$rotdamping 1.5
$rootbone "mario_L_surfing"

$jointconstrain "Head" x limit -55 25 0
$jointconstrain "Head" y limit -25 25 0
$jointconstrain "Head" z limit -65 65 0

}

giugirl  [author] 22 May, 2020 @ 10:28pm 
@LeftyGreenMario
Also take a closer look at them when you put them in gmod, here’s their links:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1720363245
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1735929341
So tell me that I can make a bit more detailed report to my friend when is their turn (before he can see then himself) 👍
giugirl  [author] 22 May, 2020 @ 10:23pm 
@LeftyGreenMario
Yep, I will tell my friend about it (he already brought Alice to gmod, but first we need to give attention to the others who need to be modeled and ported then we can make her officially public (after the last minor harmless issue is fixed) and do the converting to gmod process on those two); also according to the tests I did on them: they spawn in their t-pose position but in a lie down position (as you see on wiz), the tools don’t affect them and when I tried to do the prop dynamic create command on them nothing seemed to happen or a error prop appears, but is possible to both decompile and recompile them.
LeftyGemsMagpie 22 May, 2020 @ 9:55pm 
guess it's an old screenie but they're like this because they lack a collision model and the model needs to have joint constraints written (so limbs bend fine).
giugirl  [author] 22 Feb, 2020 @ 10:49am 
me, bro (he is poking wiz with a stick just to see if he show any reaction) and some of our friends who are with us are like: “are they ok”?, “they are really alive”?, “they seem to be live and breathing but at same time unconscious and fully latent like concrete statues of themselves”!, “should we bring them to our home”?, “guess we REALLY need to bring them to our house after all we cannot leave someone of their kind alone specially like this”!...
2Sleepee 22 Feb, 2020 @ 10:36am 
Try the Dust and Fidget Model, then you will understand pain