Exploding Body Parts

 

 

philip
profile | email

posted 09-03-98 8:50 PM CT (US)
Title: Exploding Body Parts
Difficulty: Easy
By: Philip (aka Maj.Bitch)
Email: peblair@gv.net // please report any bugs(??)
Date: 8-31-98
Note: Please give credit where credit is due.

=============================================================
I did this mod before and posted a different version of it.
This one has been modified somewhat since then so I packaged
it back up and decided to post it for everyone who might be
interested in it.

Here goes..

This is a simple mod which displays body parts (standard issue
Quake2 files) when the player dies a violent death but not to
such an extent that they 'spray' everywhere. I believe that
the original Quake2 DLL file was built with this kind of 'gore'
in mind (after all, they did create the graphics files and did
place them in the pak files!!) but for some reason they only
had the 'blood spray' implemented. This mod puts the original
'realism' back into the code.

Read On!

If a player's final death health (if that makes sense!!) total
is < -15 then the player died a violent death (otherwise, the
player's body just collapses to the ground). If the player's
death was very extreme, in other words, their final health total
was < -50, then we just splatter the player with some gib chunks
and blood spray. If the player's death health is between
-15 and -50 then we throw the player's body parts everywhere!
The gibs disappear in a normal fashion after the normal time
(approx. 30 secs).

Go Ahead! PUT SOME REALISM BACK INTO YOUR MOD!!

=============================================================
============== Q_SHARED.H MODIFICATIONS =====================
=============================================================
Add these defines to q_shared.h

// Body Gibs.
#define GIB_SM_MEAT_MODEL "models/objects/gibs/sm_meat/tris.md2"
#define GIB_ARM_MODEL "models/objects/gibs/arm/tris.md2"
#define GIB_LEG_MODEL "models/objects/gibs/leg/tris.md2"
#define GIB_BONE_MODEL "models/objects/gibs/bone/tris.md2"
#define GIB_BONE2_MODEL "models/objects/gibs/bone2/tris.md2"
#define GIB_CHEST_MODEL "models/objects/gibs/chest/tris.md2"
#define GIB_SKULL_MODEL "models/objects/gibs/skull/tris.md2"
#define GIB_HEAD_MODEL "models/objects/gibs/head/tris.md2"
#define GIB_HEAD2_MODEL "models/objects/gibs/head2/tris.md2"

#define UDEATH_SOUND gi.soundindex("misc/udeath.wav")

=============================================================
============== P_CLIENT.C MODIFICATIONS =====================
=============================================================
Add this new function to p_client.c

void Throw_Body_Parts_Everywhere(edict_t *victim, int damage) {
int n;

// Throw Gibs everywhere..
for (n=0; n<2; n++) // throw 2 misc bones>
ThrowGib(victim, GIB_BONE_MODEL, damage, GIB_ORGANIC);
for (n=0; n<1; n++) // throw 1 skull>
ThrowGib(victim, GIB_SKULL_MODEL, damage, GIB_ORGANIC);
for (n=0; n<2; n++) // throw 2 meat chunks>
ThrowGib(victim, GIB_SM_MEAT_MODEL, damage, GIB_ORGANIC);
for (n=0; n<2; n++) // throw 2 arms>
ThrowGib(victim, GIB_ARM_MODEL, damage, GIB_ORGANIC);
ThrowGib(victim, GIB_CHEST_MODEL, damage, GIB_ORGANIC);
for (n=0; n<2; n++) // throw 2 legs>
ThrowGib(victim, GIB_LEG_MODEL, damage, GIB_ORGANIC);
for (n=0; n<2; n++) // throw 2 more meat chunks>
ThrowGib(victim, GIB_SM_MEAT_MODEL, damage, GIB_ORGANIC);
for (n=0; n<4; n++) // throw 4 more bones>
ThrowGib(victim, GIB_BONE2_MODEL, damage, GIB_ORGANIC);
}

=================
Comment out the body_die() function in p_client.c and paste in
the following new function in its place.

void body_die(edict_t *victim, // Player getting killed
edict_t *weapon, // unused...
edict_t *shooter, // unused...
int damage, // Player's final damage total
vec3_t point) // Player's origin at death
{
int n;

// Check to see if player had death -15 health total
if (victim->health < -15) {
// if so, first make player scream wildly...
gi.sound(victim, CHAN_BODY, UDEATH_SOUND, 1, ATTN_NORM, 0);
// if very extreme death, completely splatter the Player
if (victim->health < -50) // splatter..
for(n=0; n<=3; n++) // throw 4 meat chunks w/blood..
ThrowGib(victim,GIB_SM_MEAT_MODEL,damage,GIB_ORGANIC);
else
// else throw exploding body parts everywhere..
Throw_Body_Parts_Everywhere(victim, damage);
victim->s.origin[2] -= 48;
ThrowClientHead(victim, damage); // Blow player's viewpoint backwards 48 units
victim->takedamage=DAMAGE_NO; // Player cannot take anymore damage
} // if
}

================

That'll do it!

Happy Gib Splattering!!

regards,
Philip
aka Maj.Bitch