Modme Forums

Moving dead zombies

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: mathfag
SOLVED below



I'm making the Der Eisendrache soul collectors (the dragons) and my problem is that I can't get the zombies to move to the dragons mouth.
Basically I can't do anything to the zombie when it's "fully" dead which includes forceteleport() and playfxontag()

If I use playfxontag() after I kill him but before he's fully dead the effect will play untill he fully dies. Same with forceteleport().
Linking the zombie to another entity and using moveto() also doesn't work.
Using CloneAndRemoveEntity() just makes the zombie disappear and causes some round changing bugs.

Anyone have any experience with this?


ModmeBot:

Reply By: ihmiskeho
Assuming DE dragons work the same way MOTD wolves do.
I don't think you can move dead zombies. You need to spawn a model when a zombie dies. The difficult part is getting the gibbed limbs to work properly.
This is what I did:

function watchNearLimb()
{
    self waittill("death");        //Self = zombie
    trigger = GetEnt("dragon_trigger" ,"targetname");
    if(self IsTouching(trigger))        //if zombie in dragon trigger
    {
        clone = GetZombieClone();
        //Define model animtree, Play death anim, move etc.
    }
}
function GetZombieClone()
{
    limbs = GetGibbedLimbs(self);
    // self hide();
    zombie_clone = Spawn("script_model", self.origin);
    zombie_clone.angles = self.angles;
    zombie_clone SetModel( limbs["body"] );
    zombie_clone Attach( limbs["head"] );
    zombie_clone Attach( limbs["legs"] );
    self Delete();
    return zombie_clone;
}

function GetGibbedLimbs(zombie)        //Getting gibbed limbs
{
    a_limbs = [];
    //Default, If not gibbed
    a_limbs["head"] = zombie.headModel;        //NOT WORKING
    a_limbs["body"] = zombie.torsoDmg1;
    a_limbs["legs"] = zombie.legDmg1;

    if ( gibserverutils::IsGibbed(zombie, GIB_TORSO_RIGHT_ARM_FLAG))
    {
        if(isdefined(GIB_TORSO_RIGHT_ARM_GONE_MODEL( zombie )))
        {
            a_limbs["body"] = GIB_TORSO_RIGHT_ARM_GONE_MODEL( zombie );
        }
    }

    else if( gibserverutils::IsGibbed(zombie, GIB_TORSO_LEFT_ARM_FLAG))
    {
        if(isdefined(GIB_TORSO_UNDAMAGED_MODEL( zombie )))
        {
            a_limbs["body"] = GIB_TORSO_LEFT_ARM_GONE_MODEL( zombie );
        }
    }

    if( gibserverutils::IsGibbed(zombie, GIB_LEGS_RIGHT_LEG_FLAG) && gibserverutils::IsGibbed(zombie, GIB_LEGS_LEFT_LEG_FLAG))
    {
        if(isdefined(GIB_LEGS_NO_LEGS_MODEL( zombie )))
        {
            a_limbs["legs"] = GIB_LEGS_NO_LEGS_MODEL( zombie );
        }
    }

    else if( gibserverutils::IsGibbed(zombie, GIB_LEGS_RIGHT_LEG_FLAG) )
    {
        if(isdefined(GIB_LEGS_RIGHT_LEG_GONE_MODEL( zombie )))
        {
            a_limbs["legs"] = GIB_LEGS_RIGHT_LEG_GONE_MODEL( zombie );
        }
        
    }

    else if( gibserverutils::IsGibbed(zombie, GIB_LEGS_LEFT_LEG_FLAG) )
    {
        if(isdefined(GIB_LEGS_LEFT_LEG_GONE_MODEL( zombie )))
        {
            a_limbs["legs"] = GIB_LEGS_LEFT_LEG_GONE_MODEL( zombie );
        }
    }

    if( gibserverutils::IsGibbed(zombie, GIB_TORSO_HEAD_FLAG) )
    {
        if(isdefined(GIB_TORSO_HEAD_GONE_MODEL( zombie )))
        {
            a_limbs["head"] = GIB_TORSO_HEAD_GONE_MODEL( zombie );
        }
    }
    return a_limbs;
}

And add these to the top of the file:
//Dragons
#using scripts\shared\ai\systems\gib;
#insert scripts\shared\ai\systems\gib.gsh;

NOTE: I didn't get the head model to work, so the clone will spawn without a head. I recommend checking out gib.gsc in scripts\shared\ai\systems to find a fix.
Everything else should work tho, not tested with custom zombie models.
Hope this helps!


ModmeBot:

Reply By: Harry Bo21
Can’t move them after they have “died” because they are rag doll. You need to handle it in their death anim script or on death event


ModmeBot:

Reply By: mathfag

ihmiskeho
Assuming DE dragons work the same way MOTD wolves do.I don't think you can move dead zombies. You need to spawn a model when a zombie dies. The difficult part is getting the gibbed limbs to work properly. This is what I did: function watchNearLimb() { self waittill("death"); //Self = zombie trigger = GetEnt("dragon_trigger" ,"targetname"); if(self IsTouching(trigger)) //if zombie in dragon trigger { clone = GetZombieClone(); //Define model animtree, Play death anim, move etc. } } function GetZombieClone() { limbs = GetGibbedLimbs(self); // self hide(); zombie_clone = Spawn("script_model", self.origin); zombie_clone.angles = self.angles; zombie_clone SetModel( limbs["body"] ); zombie_clone Attach( limbs["head"] ); zombie_clone Attach( limbs["legs"] ); self Delete(); return zombie_clone; } function GetGibbedLimbs(zombie) //Getting gibbed limbs { a_limbs = []; //Default, If not gibbed a_limbs["head"] = zombie.headModel; //NOT WORKING a_limbs["body"] = zombie.torsoDmg1; a_limbs["legs"] = zombie.legDmg1; if ( gibserverutils::IsGibbed(zombie, GIB_TORSO_RIGHT_ARM_FLAG)) { if(isdefined(GIB_TORSO_RIGHT_ARM_GONE_MODEL( zombie ))) { a_limbs["body"] = GIB_TORSO_RIGHT_ARM_GONE_MODEL( zombie ); } } else if( gibserverutils::IsGibbed(zombie, GIB_TORSO_LEFT_ARM_FLAG)) { if(isdefined(GIB_TORSO_UNDAMAGED_MODEL( zombie ))) { a_limbs["body"] = GIB_TORSO_LEFT_ARM_GONE_MODEL( zombie ); } } if( gibserverutils::IsGibbed(zombie, GIB_LEGS_RIGHT_LEG_FLAG) && gibserverutils::IsGibbed(zombie, GIB_LEGS_LEFT_LEG_FLAG)) { if(isdefined(GIB_LEGS_NO_LEGS_MODEL( zombie ))) { a_limbs["legs"] = GIB_LEGS_NO_LEGS_MODEL( zombie ); } } else if( gibserverutils::IsGibbed(zombie, GIB_LEGS_RIGHT_LEG_FLAG) ) { if(isdefined(GIB_LEGS_RIGHT_LEG_GONE_MODEL( zombie ))) { a_limbs["legs"] = GIB_LEGS_RIGHT_LEG_GONE_MODEL( zombie ); } } else if( gibserverutils::IsGibbed(zombie, GIB_LEGS_LEFT_LEG_FLAG) ) { if(isdefined(GIB_LEGS_LEFT_LEG_GONE_MODEL( zombie ))) { a_limbs["legs"] = GIB_LEGS_LEFT_LEG_GONE_MODEL( zombie ); } } if( gibserverutils::IsGibbed(zombie, GIB_TORSO_HEAD_FLAG) ) { if(isdefined(GIB_TORSO_HEAD_GONE_MODEL( zombie ))) { a_limbs["head"] = GIB_TORSO_HEAD_GONE_MODEL( zombie ); } } return a_limbs; } And add these to the top of the file: //Dragons #using scripts\shared\ai\systems\gib; #insert scripts\shared\ai\systems\gib.gsh; NOTE: I didn't get the head model to work, so the clone will spawn without a head. I recommend checking out gib.gsc in scripts\shared\ai\systems to find a fix. Everything else should work tho, not tested with custom zombie models.Hope this helps!


Works.
Thank you.


ModmeBot:

Reply By: Harry Bo21
This is not the proper way


ModmeBot:

Reply By: mathfag

Harry Bo21
This is not the proper way

Well then how do I change the death anim on specific zombies in the death callback?
Turns out the other guys thing doesn't fit in because the tag origin changes position


ModmeBot:

Reply By: Harry Bo21
return 1 at the end of the death event callback so it doesnt continue the normal logic after if i recall


ModmeBot:

Reply By: mathfag
I went with this after the death event callback

temp = Spawn("script_model",zom.origin); //zom = killed zombie
temp.angles = zom.angles;
temp SetModel("tag_origin");


	zombie = Spawn("script_model", zom.origin);
	zombie.angles = zom.angles;
	zombie UseAnimTree(#animtree);
	zombie SetModel(zom.model);
	zombie.head = Spawn("script_model", zombie GetTagOrigin("j_head"));
	zombie.head.angles = zombie.angles;
	zombie.head SetModel(zom.headModel);
	zombie.head LinkTo(zombie);
	zombie AnimScripted( ZOM_IMPACT, zombie.origin, zombie.angles, ZOM_IMPACT,"normal",ZOM_IMPACT,1,0.5 );
	zombie EnableLinkTo();
	zombie LinkTo(temp);


and it works great


Special thanks to:
HarryBo21
alexisloic21
<h2 class="old-h2"> </h2>