News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

Gib me some help

Started by Mr A, August 03, 2014, 08:16:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mr A

I'm trying to modify the gibing system in Doom 3, so when a monster gibs, all the chunks stay...
I think I've isolated the relevant code in game\item.cpp

/*
============
idMoveableItem::Gib
============
*/
void idMoveableItem::Gib( const idVec3 &dir, const char *damageDefName ) {
// spawn smoke puff
const char *smokeName = spawnArgs.GetString( "smoke_gib" );
if ( *smokeName != '\0' ) {
const idDeclParticle *smoke = static_cast<const idDeclParticle *>( declManager->FindType( DECL_PARTICLE, smokeName ) );
gameLocal.smokeParticles->EmitSmoke( smoke, gameLocal.time, gameLocal.random.CRandomFloat(), renderEntity.origin, renderEntity.axis );
}
// remove the entity
PostEventMS( &EV_Remove, 0 );
}


I'm guessing the last line of that deals with them fading, with the number being the delay?

But then I found this code in game\actor.cpp
/*
============
idActor::Gib
============
*/
void idActor::Gib( const idVec3 &dir, const char *damageDefName ) {
// no gibbing in multiplayer - by self damage or by moving objects
if ( gameLocal.isMultiplayer ) {
return;
}
// only gib once
if ( gibbed ) {
return;
}
idAFEntity_Gibbable::Gib( dir, damageDefName );
if ( head.GetEntity() ) {
head.GetEntity()->Hide();
}
StopSound( SND_CHANNEL_VOICE, false );
}

And:
/*
=====================
idActor::SpawnGibs
=====================
*/
void idActor::SpawnGibs( const idVec3 &dir, const char *damageDefName ) {
idAFEntity_Gibbable::SpawnGibs( dir, damageDefName );
RemoveAttachments();
}

Also I noticed the "if ( ( health < -20 )" line in the damage section. 

So yeah, would I just have to alter the PostEventMS in idMoveableItem::Gib to stop gibs fading?
Also how could I implement an alternate gibbing with alternate weapons? So for instance; explosive weapons would leave big chunks of flesh, while a plasma weapon would leave fleshless skeletons.

VGames

Does anybody have an answer for this???
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500