Is there a script or hook that when my Antlions die, they retain their Color and Hull Size? Or even if they are shrunk by like 50%, and they are killed, can they retain that ragdoll?
https://files.facepunch.com/forum/upload/113994/1560864f-10c4-43be-b797-ce7b62158937/20180219145912_1.jpg
https://files.facepunch.com/forum/upload/113994/0dc49eec-b88f-46cd-bc37-10e7a84e1aca/20180219145904_1.jpg
You will probably have to use GM/CreateEntityRagdoll and manualy set the ragdoll model scale and color
It's something that I'd want to fix in GMod by default actually
Good luck changing the scale of the ragdoll... I gave up on that.
Is that even possible to do? Like rigging the ragdoll to be in the exact position, velocity, etc?
TTT does it with regular human ragdolls atleast.
https://github.com/Facepunch/garrysmod/blob/bece6cc34eec88f058de722ebf3008521a4bc62e/garrysmod/gamemodes/terrortown/gamemode/corpse.lua#L435
i fucking hate this editor
Did not realize SetModelScale does not work properly with ragdolls, my bad.
Huh. That's impressive. So it would be a custom function then. How would I make that custom function?
function ENT:KeepNPCTraits(npc)
local npc = self.npc
if IsValid(self.corpse) then
self.corpse = ents.Create("prop_ragdoll")
self.corpse:SetModel( npc:GetModel() )
self.corpse:SetPos( npc:GetPos() )
self.corpse:SetAngles( npc:GetAngles() )
self.corpse:SetSkin(npc:GetSkin())
self.corpse:SetNotSolid(false)
self.corpse:SetNoDraw(false)
self.corpse:SetColor( Color( 100, 0, 15, 255) )
self.corpse:Spawn()
npc:Remove()
end
end
I'm not great at coding... :P
Actually NPCs ragdolls are ClientsideRagdoll, as I know.
Only if ai_keepcorpses is disabled. Otherwise it creates a regular prop_ragdoll
Oh wow, it's very nice to see this officially in the game. Good job Rubat!
Sorry, you need to Log In to post a reply to this thread.