• Death Animation And Then Ragdoll
    35 replies, posted
Ive thought that it was always cool in games like call of duty modern warfare that when you died it played an animation sometimes and THEN there was a ragdoll, I was wondering if ths was possible for Garrys Mod, Or Half Life 2, OR ANY source game for that matter lol, if there is a possibiity, maybe someone could make this and post it? cause im not an LUA coder at al lol, well at least for Gmod, Thanks -Troy
[QUOTE=TroyIrving;22168814]Ive thought that it was always cool in games like call of duty modern warfare that when you died it played an animation sometimes and THEN there was a ragdoll, I was wondering if ths was possible for Garrys Mod, Or Half Life 2, OR ANY source game for that matter lol, if there is a possibiity, maybe someone could make this and post it? cause im not an LUA coder at al lol, well at least for Gmod, Thanks -Troy[/QUOTE] I highly approve of this, not because it's MW2 but because it's never been done before. And I want some realistic deaths, not the ones where your body flops around and ends up in some awkward position, it's really weird to take photos of yourself or something. And I'm wanting some more custom death things on the site, I die too often and I want something new.
lol nice, but i dont want it because mw2, i hate that game in fact, but it was just an examle that most people would know, i hope someone picks up on this [editline]11:40PM[/editline] OH! And another idea, if the animation is playing, and the player hits something, like a prop, or another ragdoll, or a wall, if it is possible, could someone make it so when he hits something like that, the animation ends, and it turns into a ragdoll [editline]11:42PM[/editline] AND Another edit, im gona try to figure out something for this myself, but if someone with Gmod LUA Expirience could do it, that would be great
Wow lol, i wish others actually wanted this and wwould POST IN IT! lol
I want it, I want some cool looking deaths not those messed up poses where your leg is over your head and your arm is touching your other legs and your back is touching your other hand.
Bump
[QUOTE=TroyIrving;22168814]wondering if ths was possible for Garrys Mod, Or Half Life 2, OR ANY source game for that matter lol, i[/QUOTE] This is done in both TF2 and both Left 4 Dead games The TF2 part is the better bet because its in the orange box.
I really uuuuujjujuuuuuuuuuuuuj [editline]13th December 2010[/editline] Wow... what happened there. I ment to say I really want this aswell
The main reason GMod death ragdolling looks awkward is because Garry changed the ragdoll physics to be more suitable for posing. This leads to worse looking NPC deaths. This is possible though.
That's a good idea. Not only with players, but NPCs too! I'm tired of having dead NPCs in awkward positions or always with their feet up their butt
Okay someone needs to stop saying what they hate about the current poses and do something about the animations. Durr.....
This is a great idea. I support this.
What I would do is remove the player's ragdoll, spawn a temporary model to play the death animation in the player's position, then remove it and create the player's ragdoll again. That way you wouldn't need to write work-arounds for any post-death logic that uses Player:Alive().
If only you were able to apply half the power to each bone of an animation to a ragdoll..
[QUOTE=Skuch;26912346]If only you were able to apply half the power to each bone of an animation to a ragdoll..[/QUOTE] Sakarias88 did that in his RagMorph addon ([url]http://www.facepunch.com/threads/895957[/url])
[QUOTE=Skuch;26912346]If only you were able to apply half the power to each bone of an animation to a ragdoll..[/QUOTE] You can easily do this. I'm pretty sure there's a function for applying force to certain bones.
[QUOTE=TroyIrving;22168814]Ive thought that it was always cool in games like call of duty modern warfare that when you died it played an animation sometimes and THEN there was a ragdoll, I was wondering if ths was possible for Garrys Mod, Or Half Life 2, OR ANY source game for that matter lol[/QUOTE] You've played left 4 dead, right?
nooo the posting ended! i really want that its so epic
Bamp
I'd really love this. In fact, I might even invest the following three years of my life towards the Source Development Kit, so that I get experience in gmod mod making and maybe then I can figure out how to make this now I wonder if the Source Dev Kit has ragdoll joint restrictions...
I'm going to try to do this since I have nothing else to do
[QUOTE=MPan1;48815421]I'm going to try to do this since I have nothing else to do[/QUOTE] you probably can't without compiling new animations which would need you to recompile every player model in the game because source engine is shit
Well, this is what I have- (I wasn't thinking as much about the animations as I was about just getting anything to play on a model in the player's position) :snip: New code below. [editline]3rd October 2015[/editline] [QUOTE=legendofrobbo;48816010]you probably can't without compiling new animations which would need you to recompile every player model in the game because source engine is shit[/QUOTE] Dammit, [URL="http://wiki.garrysmod.com/page/Player_Animations#/Animators"]you're right.[/URL] Oh, this is interesting-there's death animations ALREADY in gmod- [CODE] ACT_GMOD_DEATH [/CODE] [editline]3rd October 2015[/editline] Sweet, I checked HLMV and there are 4 different death anims! (death_01, death_02, death_03 and death_04)! We could probably use them for this ... right? (I used them in the code) I updated the code to ACTUALLY PLAY the animations now! The only problem is I'm not sure how to spawn a ragdoll with the bone positions of the previous base_gmodentity! [CODE] CreateConVar( 'deathanimation_enabled', '1', { FCVAR_CHEAT, FCVAR_REPLICATED, FCVAR_NOTIFY }, 'Sets whether a death animation should play when a player dies.' ) local enabled = GetConVar( 'deathanimation_enabled' ) hook.Add( 'PlayerDeath', 'DeathAnimation', function( victim, inflictor, attacker ) if !enabled:GetBool() then return end --If the convar isn't enabled then skip all this (also, you might want to check if the player fell or exploded, because both look unrealistic if this animation is played) victim.LetRespawn = false -- Don't let the player respawn until we're done with the animation victim:GetRagdollEntity():Remove() -- Remove the ragdoll of the player local FakePly = ents.Create( 'base_gmodentity' ) FakePly:SetModel( victim:GetModel() ) FakePly:SetPos( victim:GetPos() ) FakePly:SetAngles( victim:GetAngles() ) FakePly:Spawn() local seq = "death_0"..math.random( 1, 4 ) FakePly:SetSequence( FakePly:LookupSequence( seq ) ) --Set a random death animation FakePly:SetPlaybackRate( 1 ) FakePly.AutomaticFrameAdvance = true --Auto advance the animation function FakePly:Think() --This makes it actually play self:NextThink( CurTime() ) return true end timer.Simple( FakePly:SequenceDuration( seq ), function() --Or however long the sequence goes for before a ragdoll is spawned in place local Rag = ents.Create( 'prop_ragdoll' ) Rag:SetModel( victim:GetModel() ) Rag:SetPos( victim:GetPos() ) Rag:SetAngles( victim:GetAngles() ) FakePly:Remove() --for i = 0, Rag:GetBoneCount() - 1 do -- Doesn't work since SetBonePosition is clientside (THIS NEEDS FIXING) -- local vec, ang = victim:GetBonePosition( i ) -- Rag:SetBonePosition( i, vec, ang ) --end Rag:Spawn() victim.Ragdoll = Rag victim.LetRespawn = true end ) end ) hook.Add( 'PlayerDeathThink', 'DeathAnimationThink', function( ply ) if enabled:GetBool() and !ply.LetRespawn then return false end --Don't let them respawn! end ) hook.Add( "PlayerSpawn", "DeathAnimationRemoveRagdoll", function( ply ) if ply.Ragdoll ~= nil then ply.Ragdoll:Remove() ply.Ragdoll = nil end -- Remove the ragdoll we spawned end ) [/CODE]
[QUOTE=MPan1;48819259] -snip- [/QUOTE] I'd be interested in incorporating this into my BGO mod. I have some code in there already that copies the player's pose and applies it to the ragdoll, so I think that this could be merged in with some slight modification. Let me know if you're interested. If not, you can use the code from there anyways.
:snip: stupid post
So... is there still mod or something?
[QUOTE=Fidagu;50492610]So... is there still mod or something?[/QUOTE] Someone's probably figured out how to fix my code by now, but currently I have this problem: [media]https://www.youtube.com/watch?v=Uo6X1omTx-w[/media] [editline]11th June 2016[/editline] I just can't figure out how to set ragdoll bone positions, but someone on Steam thought of a better way to do it, I just forgot to try it [editline]11th June 2016[/editline] Since I have nothing better to do today, I think I'll try working on this thing some more to see if I can get it to work, I'll post anything here if it works
[QUOTE=MPan1;50494563] -snip- [/QUOTE] I've found a couple of shared functions called ManipulateBonePosition and ManipulateBoneAngles. I tried them out, but I get a pretty interesting issue. Ignore the text above the player and the level thing. [video=youtube;Pm-zAgKYZXE]https://www.youtube.com/watch?v=Pm-zAgKYZXE&feature=youtu.be[/video]
I thought about using those functions, but they seem to 'set custom bone offsets' rather than setting the actual position (without offsetting it).
[QUOTE=MPan1;50495147]I thought about using those functions, but they seem to 'set custom bone offsets' rather than setting the actual position (without offsetting it).[/QUOTE] It looks like that's what it's doing in the video, I'll try and do some work on the code, and I'll report back with what I got.
Sorry, you need to Log In to post a reply to this thread.