• Simple bonemerging problem
    5 replies, posted
Does anyone know why this incredibly simple thing doesn't bonemerge properly? [CODE] local ply = Entity(1) local ent = ents.Create( 'base_gmodentity' ) ent:SetModel( ply:GetModel() ) ent:SetPos( ply:GetPos() ) ent:SetAngles( ply:GetAngles() ) ent:Spawn() ent:Activate() local rag = ents.Create( 'prop_ragdoll' ) -- This ragdoll sometimes gets origin errors and gets removed for some odd reason rag:SetModel( 'models/player/kleiner.mdl' ) rag:SetPos( ply:GetPos() ) rag:SetAngles( ply:GetAngles() ) rag:Spawn() rag:Activate() rag:SetParent( ent ) -- I'm running this serverside first, then clientside using the net library rag:AddEffects( EF_BONEMERGE ) -- Same for this [/CODE] All I want to do is bonemerge the rag to the ent, and I can't figure out how to do it. I've never tried bonemerging before though, so it's probably a really simple mistake. And yes, I've tried giving the ent a physics object, that didn't change anything. [editline]17th June 2016[/editline] Even if I give the ragdoll the exact same model as the ent, it still won't merge properly. The most annoying part is that I can merge the rag and the ent perfectly fine with the [URL="https://steamcommunity.com/sharedfiles/filedetails/?id=170917418"]Easy Bonemerge tool[/URL], but I checked its code, and it seems to be doing the same thing I am. Anyone know the problem?
I've never bonemerged an actual ragdoll, only clientside models. You can't get away with doing that? Instead of using the base entity create your own, have it create a clientside model on init clientside?
rag:SetParent( ent, 0 ) You only need it serverside.
[QUOTE=Robotboy655;50538378]rag:SetParent( ent, 0 ) You only need it serverside.[/QUOTE] Thanks for the suggestion, but it still has the same problem of the ragdoll flying through the floor. Try this if you want to check: [CODE] local ply = Entity(1) local ent = ents.Create( 'base_gmodentity' ) ent:SetModel( ply:GetModel() ) ent:SetPos( ply:GetPos() ) ent:SetAngles( ply:GetAngles() ) ent:Spawn() ent:Activate() local rag = ents.Create( 'prop_ragdoll' ) rag:SetModel( 'models/player/kleiner.mdl' ) rag:SetPos( ply:GetPos() ) rag:SetAngles( ply:GetAngles() ) rag:Spawn() rag:Activate() rag:SetParent( ent, 0 ) rag:AddEffects( EF_BONEMERGE ) [/CODE]
[url]https://facepunch.com/showthread.php?t=789234[/url] This maybe?
That'd probably work, but I don't know what I should be attaching. Also, the Easy Bonemerge Tool doesn't use SetParentAttachment at all, yet it somehow manages to merge the rag and the ent. I'm probably missing something really basic, but I just can't figure out what to do. [editline]18th June 2016[/editline] I think I figured it out - It's impossible to bonemerge a ragdoll to an animated entity while the ragdoll is still a prop_ragdoll, or while the animated entity is still animated. Great.
Sorry, you need to Log In to post a reply to this thread.