• Overriding death ragdolls?
    4 replies, posted
I'm trying to replace death ragdolls with my own entities, kind of like dismemberment mod, except to achieve a different end. However, hooking Create Clientside Ragdoll fails to remove aforementioned ragdoll. I checked dismemberment mod itself but I haven't been able to figure out what the guy actually does to override the default ragdoll, from the looks of it he doesnt hook anything. Can someone help me out?
[lua]--[[--------------------------------------------------------- Name: gamemode:DoPlayerDeath( ) Desc: Carries out actions when the player dies -----------------------------------------------------------]] function GM:DoPlayerDeath( ply, attacker, dmginfo ) ply:CreateRagdoll() ply:AddDeaths( 1 ) if ( attacker:IsValid() && attacker:IsPlayer() ) then if ( attacker == ply ) then attacker:AddFrags( -1 ) else attacker:AddFrags( 1 ) end end end[/lua] Just modify the "CreateRagdoll()" part.
Hmm, so it never activates a hook, then? And I suppose I'd do something similar for NPCs? [editline]27th February 2014[/editline] also it doesn't say on the wiki but does CreateRagdoll return the ragdoll entity it created?
[QUOTE=BFG9000;44070126]Hmm, so it never activates a hook, then? And I suppose I'd do something similar for NPCs? [editline]27th February 2014[/editline] also it doesn't say on the wiki but does CreateRagdoll return the ragdoll entity it created?[/QUOTE] I assume it creates a ragdoll only. [url]http://wiki.garrysmod.com/page/Player/CreateRagdoll[/url] Also I noticed there is another function, altho I am not sure if it works: [lua]--[[--------------------------------------------------------- Name: gamemode:CreateEntityRagdoll( entity, ragdoll ) Desc: A ragdoll of an entity has been created -----------------------------------------------------------]] function GM:CreateEntityRagdoll( entity, ragdoll ) end[/lua]
Yeah, I know about that one but havent gotten around to testing it.
Sorry, you need to Log In to post a reply to this thread.