GMod-Infinite-Map icon indicating copy to clipboard operation
GMod-Infinite-Map copied to clipboard

Ragdoll support?

Open 0RadicalLarry0 opened this issue 3 years ago • 16 comments

Is ragdoll support planned or something that will not be added?

0RadicalLarry0 avatar Nov 21 '22 06:11 0RadicalLarry0

I think it'll work if you turn real ragdolls on, but the fake ones have always had trouble colliding with anything that wasn't map brush. That seems unlikely to change, especially since it's a tiny tiny thing.

DarianLStephens avatar Nov 21 '22 08:11 DarianLStephens

blame source, I cant setpos a ragdoll across chunks also I am not entirely sure what you mean by "ragdoll support"

meetric1 avatar Nov 22 '22 13:11 meetric1

Serverside ragdolls is what I'm referring to. They disappear when passing through chunks.

"Some entities, such as ragdolls, will appear unaffected by this function in the next frame. Consider PhysObj:SetPos if necessary." https://wiki.facepunch.com/gmod/Entity:SetPos

0RadicalLarry0 avatar Nov 24 '22 03:11 0RadicalLarry0

I tried that, but I think since we are teleporting the ragdoll across such a massive distance it explodes and I get crazyphysics errors

I tried entity:SetRagdollPos too but I had the same problem, ill keep trying

meetric1 avatar Nov 24 '22 15:11 meetric1

I whipped up a script that teleports ragdolls to the player

https://pastebin.com/FFyvfxCg

0RadicalLarry0 avatar Nov 25 '22 04:11 0RadicalLarry0

lol I clicked off of gmod and closed the issue accidentally, sorry!

0RadicalLarry0 avatar Nov 25 '22 04:11 0RadicalLarry0

I can't change it now, but I realize I can just do return isRag[ent:GetClass()] or ent:GetNWBool("RM_Ragmod", false)

instead of if isRag[ent:GetClass()] or ent:GetNWBool("RM_Ragmod", false) then return true else return false end

on line 6

0RadicalLarry0 avatar Nov 25 '22 09:11 0RadicalLarry0

I updated the script with previously mentioned changes and added PhysObj:SetAngleVelocityInstantaneous() for maintaining angular velocity

https://pastebin.com/ZiQwPYJf

0RadicalLarry0 avatar Nov 26 '22 06:11 0RadicalLarry0

tried it out, it works great! well, it works until you try and teleport across the map.. then I get crazyphysics errors

edit: I edited some functions, its almost working but it for some reason still doesn't want to teleport

edit 2: ok! its working but the ragdoll isnt being rendered for some reason across chunks

meetric1 avatar Nov 27 '22 22:11 meetric1

bad news, you cant detour the rendering of a ragdoll (atleast in the way im doing it), it remains invisible across chunks

but at least the setpos will work!

meetric1 avatar Nov 27 '22 22:11 meetric1

You may be able to alter the rendering of ragdolls using the BuildBonePositions callback

You have to modify the matrix of the bones and end it with Entity:SetBoneMatrix(), be sure to do it all on the client!

https://wiki.facepunch.com/gmod/Entity_Callbacks https://wiki.facepunch.com/gmod/Entity:SetBoneMatrix https://wiki.facepunch.com/gmod/Entity:GetBoneMatrix

0RadicalLarry0 avatar Nov 27 '22 23:11 0RadicalLarry0

I made this ragdoll offset using CSEnts but the CSEnt is only visible at certain positions for some reason... I'm still trying to figure it out

https://pastebin.com/7P7W73kW

0RadicalLarry0 avatar Dec 03 '22 10:12 0RadicalLarry0

It's just cause the actual position of the CSEnt is not updated lol

0RadicalLarry0 avatar Dec 03 '22 10:12 0RadicalLarry0

fixed with Entity:SetRenderBounds() instead

0RadicalLarry0 avatar Dec 03 '22 10:12 0RadicalLarry0

updated script, has questionable performance at times but is a good proof of concept

https://pastebin.com/xxAuPPyy

https://i.imgur.com/4bW7xfd.png

0RadicalLarry0 avatar Dec 03 '22 11:12 0RadicalLarry0

performance may be impacted by setting the render bounds as high as I did, although without setting the position of the CSEnt constantly I'm not sure how to fix that. Without either the CSEnt will disappear when it's not in view

0RadicalLarry0 avatar Dec 03 '22 11:12 0RadicalLarry0