Jump to content

Limbs to not disappear


Recommended Posts

This part in g_combat.c:G_Dismember()

        G_SetOrigin( limb, newPoint );
        VectorCopy( newPoint, limb->s.pos.trBase );
        limb->think = LimbThink;
        limb->touch = LimbTouch;
        limb->speed = level.time + Q_irand(8000, 16000);
        limb->nextthink = level.time + FRAMETIME;

limb->speed is time when a limb will disappear.

Link to comment

This part in g_combat.c:G_Dismember()

        G_SetOrigin( limb, newPoint );
        VectorCopy( newPoint, limb->s.pos.trBase );
        limb->think = LimbThink;
        limb->touch = LimbTouch;
        limb->speed = level.time + Q_irand(8000, 16000);
        limb->nextthink = level.time + FRAMETIME;

limb->speed is time when a limb will disappear.

That is for MP only.. I am looking for SP code.

Link to comment

I think it's cvar related. See in cvarlist if there's anything that rings a bell

That is not the case here. There is only bodies removal time. 

 

I found the code lines that when limb is in solid it is removed. BUT if the limb is rotating or moving - it wont be removed from the game. Maybe some of You saw that limb of the enemy that was cut off - if it will fall on the mountain or the edge - it will slowly go down and limb will roatate. I found out that if this happens - the limbs stay in the game forever until they stop moving. 

 

I just want in my map to walk with the bodies laying around and body parts to make everything so much more brutal.

Link to comment

I just want in my map to walk with the bodies laying around and body parts to make everything so much more brutal.

 

Wouldn't in that scenario be preferable to create a .md3 file with the body parts scattered around to be used as a misc_model entity? If you edit the code, think how much resources it will take to keep rendered all the body parts all the time. 

Link to comment

Wouldn't in that scenario be preferable to create a .md3 file with the body parts scattered around to be used as a misc_model entity? If you edit the code, think how much resources it will take to keep rendered all the body parts all the time.

 

I dont want to make them stay forever but much much longer. I know that i can make MD3 bodies with flesh and body parts all over the place.

Link to comment
  • 4 weeks later...

Try increasing values of Q_irand(), or replace them with constants in milliseconds in g_combat.c:LimbThink()

                if ( level.time > ent->s.apos.trTime + ent->s.apos.trDuration )
                {
                        if (ent->owner && ent->owner->m_pVehicle)
                        {
                                ent->nextthink = level.time + Q_irand( 10000, 15000 );
                        }
                        else
                        {
                                ent->nextthink = level.time + Q_irand( 5000, 15000 );
                        }

                        ent->e_ThinkFunc = thinkF_G_FreeEntity;
                        //FIXME: these keep drawing for a frame or so after being freed?!  See them lerp to origin of world...              
                }

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...