garrysmod-issues icon indicating copy to clipboard operation
garrysmod-issues copied to clipboard

ManipulateBonePosition() and BuildBonePositions hook don't work with ragdolls

Open TurbomanAlco opened this issue 12 years ago • 6 comments

I've noticed that ManipulateBonePosition() doesn't completely work with ragdolls and the BuildBonePositions hook doesn't work with ragdolls at all. When you use ManipulateBonePosition() with a ragdoll, most bones refuse to move. I'm not sure if it's supposed to be that way, but I find it weird and I kind of want to use this code in my Dismemberment Mod. Also, I've noticed that when ManipulateBonePosition() is used on a clientside model, you have to use the code on every single bone and set each bone offset to a zeroed out vector before using the code again for it to work properly. However this does not appear to be the case when using ManipulateBonePosition() on NPCs and players. I've tried the same thing with ragdolls as well, and I had no luck.

And for the BuildBonePositions hook, I haven't tested it out with scripted entities, but I have tried to use it with ragdolls, clientside models, and players. It only worked on players when I used the AddCallback() code and I'm sure it works with NPCs too.

TurbomanAlco avatar Jun 30 '13 03:06 TurbomanAlco

prop_ragdoll and hl2mp_ragdoll have internal classes that actually manage the bone data of the ragdoll. Since they don't call their BaseClass' SetupBones under most conditions, manual hook calls and ManipulateBone* function redirections might have to be added there. Really, ragdolls should just have their own metatable added at this point.

Kefta avatar Mar 15 '19 13:03 Kefta

Bump.

NathanX-S avatar Oct 08 '19 12:10 NathanX-S

Please fix this. It's over a decade old bug at this point.

WinterPhoenix avatar May 10 '24 04:05 WinterPhoenix

I don't think it can be fixed? Bone positions of ragdolls are dictated by the positions of their associated Physics Objects, not the other way around.

robotboy655 avatar May 10 '24 08:05 robotboy655

Is there an alternative solution in which we could manipulate the physics objects instead for the same effect? Modify the constraints maybe?

That all sounds really hacky though…and probably won’t work on the client

WinterPhoenix avatar May 10 '24 08:05 WinterPhoenix

I mean, if you want to manipulate physics objects, just do that, you have SetPos, etc.

robotboy655 avatar May 10 '24 09:05 robotboy655