Page 1 of 1

Excessive ragdolling

Posted: Tue Jun 04, 2013 6:36 pm
by Internet-justice
Ragdoll physics can be a lot of fun, but lately they have been abused and spammed resulting in server crashes. Can we have a rule against this?

Re: Excessive ragdolling

Posted: Tue Jun 04, 2013 6:46 pm
by Soul
orly now? I think there's only like 3 admins (that actually still play) that can ragdoll. Unless mods can ragdoll, but I'm pretty sure not. And I think this would be better in the complaint department, but this should do just fine.

Re: Excessive ragdolling

Posted: Tue Jun 04, 2013 7:04 pm
by Deth V
Give me the names of the admins who are doing that. They should NOT be doing this.

Re: Excessive ragdolling

Posted: Tue Jun 04, 2013 8:25 pm
by Internet-justice
No, I mean the ragdoll physics on dead bodies. Things like picking up bodies and banging them into walls.

Re: Excessive ragdolling

Posted: Tue Jun 04, 2013 9:23 pm
by Deth V
OH!

I'll look into disabling them all together, anything to stop server crashes.

Re: Excessive ragdolling

Posted: Tue Jun 04, 2013 11:29 pm
by Markusmoo
Yeah, It is the physics that are doing it. So basicly when a player is killed, the player turns into a ragdoll. Garry's Mod then forces the ragdoll to the ground, this is our problem. The physics are messed up at the moment.

Solution:

sv_removecrazyphysics 0

or:

Code: Select all

-- The only truly effective way to prevent all kinds of velocity and
-- inertia is motion disabling the entire ragdoll for a tick
-- for non-ragdolls this will do the same for their single physobj

hook.Add("Think","AMB_CrashCatcher",function()
	for k, ent in pairs(ents.FindByClass("prop_ragdoll")) do
		if IsValid(ent) then
			if ent.player_ragdoll then
				if ent:GetVelocity( ):Length() >= 1500 then
					for i=0, ent:GetPhysicsObjectCount()-1 do
						local subphys = ent:GetPhysicsObjectNum(i)
						if IsValid(subphys) then
							subphys:EnableMotion(false)
						end
				   	end
					ServerLog("[!CRASHCATCHER!] Caught velocity > 1500 on a ragdoll entity, negating velocity and temporarily disabling motion.\n")
					timer.Create( "AMB_ReEnable_Motion", 2.5, 1, function()
						if IsValid(subphys) then
							subphys:Wake()
						end
					end)
				end
			end
		end
	end
end)
I would suggest using the code... If that does not work, let me know and I will tweak the numbers.