Page 1 of 2

Dismemberment System

PostPosted: Sat Jan 25, 2014 6:22 pm
by TechieUK
Surprisingly, this is not a request, but a showcase of sorts.
I've been working on getting a sort of dismemberment system into a mod.
It's far from done, but I thought I'd show off what I've done so far and post updates as I make progress.
I started out by going into Silo 2 and loading in a base model.
Image

And then after that I separated limbs and the head into separate models.
Image
Image
Image

I also created a destroyed version of each model...
Image
Image

So if you import the base and then various destroyed/normal versions...
Image
G(ib)-Man.

After that, I got it into Source with bodygroups to change all the parts.
I didn't rig the fingers and I didn't mess about with the rigging 3ds max gave me, so parts may stretch out a bit in-game.
Image
Image
Image
Image
Image
Image
So there we go, that's working.

After that, I put enemy.mdl into a Source 2013 SP mod, and opened up npc_combines.cpp.
I found Event_Killed, and added in some code to change the head bodygroup on death. I also made his default model enemy.mdl instead of combine_soldier.mdl, but he still uses prisonguard and super_soldier if set to.

Alive:
Image

Dead:
Image

So the npc loses the head on death.
Image
You can sort of see the lack of head when he dies.

After this, I'm going to work on getting the bodygroup removed to change based on where the killing bullet hit, or maybe how much damage different hitboxes take. I'm also going to work on getting it to spawn gibs.

So there we go. A basic system to allow decapitation. Because of the way it works right now you can make his head come off by shooting him in the foot, but I've only been working for about an hour or so.

Thoughts?

Re: Dismemberment System

PostPosted: Sat Jan 25, 2014 8:25 pm
by LordDz
Needs more blood!
Blood for the blood god!

Re: Dismemberment System

PostPosted: Sat Jan 25, 2014 9:33 pm
by TechieUK
I'll get some new blood particles set up! :D

Re: Dismemberment System

PostPosted: Sat Jan 25, 2014 9:41 pm
by Garrador
Need gibs as well! Will follow this ;)

Re: Dismemberment System

PostPosted: Sat Jan 25, 2014 9:51 pm
by TechieUK
Definitely needs gibs, I'll probably use the non-destroyed arm models but cut some of the polys off of the end so it fits together with the destroyed ones. Also I think I might be able to make a "stream" blood particle, then try attach it to a bone on the gibs so they spurt blood everywhere as they fall to the floor.

Re: Dismemberment System

PostPosted: Sat Jan 25, 2014 10:33 pm
by TechieUK
Image
Made it take out every limb.

Re: Dismemberment System

PostPosted: Sat Jan 25, 2014 11:48 pm
by vcool
Brutal. I like it. Is the gib propulsion done by code or is the rocket explosion affecting them?

Re: Dismemberment System

PostPosted: Sun Jan 26, 2014 11:02 am
by TechieUK
The torso is pushed by the rocket explosion, just like any other npc corpse.

Re: Dismemberment System

PostPosted: Sun Jan 26, 2014 12:23 pm
by Garrador
Are they "ragdolled" as well? Should definitely be ragdolls ;)

Re: Dismemberment System

PostPosted: Sun Jan 26, 2014 12:24 pm
by [Steve]
If you have access to the dod code take a look at void CDODPlayer::TraceAttack
has everything you would need for shooting parts off players based on hitbox's/damage including spawning phys enabled gibs

Re: Dismemberment System

PostPosted: Sun Jan 26, 2014 1:05 pm
by TechieUK
Gibs will be ragdolls. I haven't got the DoD code, was it in the Source 2007 leak? I'll try and find it.

Edit:
I made some new changes, parts will only be removed if the npc is killed by an explosion, and the bodygroups will change randomly so there is a random chance of blowing each part off.

Re: Dismemberment System

PostPosted: Sun Jan 26, 2014 3:42 pm
by SM Sith Lord
Epic dude, nice work.

Re: Dismemberment System

PostPosted: Sun Jan 26, 2014 4:14 pm
by TechieUK
Randomisation in-game:

Missing an arm:
Image

Missing a leg:
Image

Missing both arms and a leg:
Image

Missing the head and a leg:
Image

Gibs will be added in a bit later.

Re: Dismemberment System

PostPosted: Sun Jan 26, 2014 7:03 pm
by Garrador
Sweet! Looking forward to updates ;)

Re: Dismemberment System

PostPosted: Sun Jan 26, 2014 7:14 pm
by TechieUK
I'm going to experiment with taking damage to see if I can allow parts to be shot off while keeping the NPC alive. Obviously I'll have to kill the NPC if they lose both legs or their head, but for the gun there might be a way to let them drop it so you can take the arms out and have a (h)armless combine soldier. Alternatively I could use StartRagdollBoogie if the NPC loses both legs so they sort of twitch about feebly when they lose their legs so they seem to be alive still.

Hmm, thinking... :D