Deflating bones on a ClientsideModel, having weird issues

This picture pretty much sums it up, I’m trying to make a clientside head gib using a physics model which is about the size of a head, and a clientside model. But whenever I deflate all the main bones attributed to physics objects, there are still some bits left that I can’t deflate because the head seems to be parented to them.

http://uppix.net/8/7/b/89f71f7b3157e9b0ae0a52a202a0b.jpg

On the left, you have a ragdoll with everything deflated except the head. On the right, you have a NPC with the exact same bones deflated. I’m having that exact same issue when doing that on a clientside model. Any idea why?
I’ve already looked at the source code from GibSplat, it’s very helpful, but since it’s based on ragdolls, it doesn’t have the issue I’m having right now. Also, I want to keep this fully clientside, nothing should be done on the server, so unless there is a way to spawn clientside ragdolls, I’d like to stay with the clientside model method.

I remember that I tried placing citizen heads on a combine guy. I tried everything and I came to the conclusion that it was impossible due to lumps.

But not all hope is lost. The latest update added ClipPlanes. You can maybe try using those?

Use :SetBonePosition() to move all the bones inside the head.

I know your method, it doesn’t work here.

I guess I’ll try that, though the part where it gets clipped will kinda look ugly since you can see through it. Bah, better than nothing.

As a matter of fact it does, all the scaling/moving is client-side in both cases. (I’ve tested myself during GS2 development)

I had this problems when developing GibSplat aswell.

But you’re using ragdolls, here I’m using a ClientsideModel, which doesn’t have physics, and apparently, they behave differently when you mess with their bones, and I have no idea why. And if you had the exact same problem as mine, how the hell did you get rid of that torso part? If I scale it down to 0, the head disappears as well, that’s kinda embarrassing.

Physics have nothing to do with bonescaling. It works on ClientModel as well.

I had a play with the head thing and I talked to ralle. He told me to put the bones inside the head and it worked.

here’s the code:

[lua]
if head and head:IsValid() then head:Remove() end

head = ClientsideModel(“models/player/Group01/male_06.mdl”)

local bonelist = {
“ValveBiped.Bip01_Pelvis”,
“ValveBiped.Bip01_Spine”,
“ValveBiped.Bip01_Spine1”,
“ValveBiped.Bip01_Spine2”,
–“ValveBiped.Bip01_Spine4”,
–“ValveBiped.Bip01_Neck1”,
–“ValveBiped.Bip01_Head1”,
“ValveBiped.forward”,
“ValveBiped.Bip01_R_Clavicle”,
“ValveBiped.Bip01_R_UpperArm”,
“ValveBiped.Bip01_R_Forearm”,
“ValveBiped.Bip01_R_Hand”,
“ValveBiped.Anim_Attachment_RH”,
“ValveBiped.Bip01_L_Clavicle”,
“ValveBiped.Bip01_L_UpperArm”,
“ValveBiped.Bip01_L_Forearm”,
“ValveBiped.Bip01_L_Hand”,
“ValveBiped.Anim_Attachment_LH”,
“ValveBiped.Bip01_R_Thigh”,
“ValveBiped.Bip01_R_Calf”,
“ValveBiped.Bip01_R_Foot”,
“ValveBiped.Bip01_L_Thigh”,
“ValveBiped.Bip01_L_Calf”,
“ValveBiped.Bip01_L_Foot”,
“ValveBiped.Bip01_R_Wrist”,
“ValveBiped.Bip01_L_Wrist”,
“ValveBiped.Bip01_L_Ulna”,
“ValveBiped.Bip01_R_Ulna”,
}

function head.BuildBonePositions(entity)
local headmatrix = LocalPlayer():GetBoneMatrix(LocalPlayer():LookupBone(“ValveBiped.Bip01_Head1”))
for key, bone in pairs(bonelist) do
local index = entity:LookupBone(bone)
local matrix = entity:GetBoneMatrix(boneIndex)
matrix:Scale(vector_origin)
matrix:SetTranslation(headmatrix:GetTranslation())
entity:SetBoneMatrix(index, matrix)
end
end

hook.Add(“RenderScene”, “PlaceHead 2”, function()

local position, angles = LocalPlayer():GetBonePosition(LocalPlayer():LookupBone("ValveBiped.Bip01_Head1"))
	
local x = angles:Up() * 0  
local y = angles:Right() * 0
local z = angles:Forward() * -65

angles:RotateAroundAxis(angles:Forward(), -90)  
angles:RotateAroundAxis(angles:Right(), -90)  
angles:RotateAroundAxis(angles:Up(), 0)  

head:SetPos(position + x + y + z)
head:SetAngles(angles)

end)
[/lua]

What it does is that it places the head ontop of your head. It looks like this taken from a good angle:

http://errur.com/New/Uploads/175.jpg

If you’re using for i = 30 or whatever number to scale all bones, don’t. I’ve tried it and it ends up looking like the model on the left.

Hope it helps!

Damn, thanks a bunch, looks like I didn’t use the right bones then. :v:
Have some hearts. :love:

Okay, it’s kinda working except a small part of the torso seems to be still there, and I have no idea how to get rid of it. If I scale down the neck, the head disappears as well, and there isn’t any other bone that I can scale down without screwing everything up.

http://uppix.net/c/c/e/ee7e50bf4c8aa74177c096e828e4a.jpg

Lol, lopping heads off is artistic :smiley: