Viper Snake
Member
I'm using the spawnMate script to spawn an axe the Minotaur boss can throw, so that when the Minotaur dies it instantly disappears with him. The problem is I also use another version of spawnMate (slightly modified so that it spawns from screen edge instead of the entity) to spawn the bosses custom health bar. Killing the Minotaur any time after he has thrown the axe seems to overwrite the previous spawnMate and the boss lifebar entity doesn't die with him. What do I need to do to get both of these entities to die at the same time?
takedamagescript that I combined with the blink script:

Code:
void spawnMate(void vName, float fX, float fY, float fZ)
{//Spawns Mate next to caller
//Spawned Mate & caller will know each other
//vName: Model name of entity to be spawned in
//fX: X location adjustment
//fZ: Y location adjustment
//fY: Z location adjustment
void self = getlocalvar("self"); //Get calling entity
int Health = getentityproperty(self, "health");
int Map = getentityproperty(self, "map");
void Mate; //Spawn object.
Mate = spawn01(vName, fX, fY, fZ); //Spawn Mate
changeentityproperty(Mate, "map", Map); //Match Mate's remap with self's
changeentityproperty(Mate, "maxhealth", Health); //Match Mate's health with self's
changeentityproperty(Mate, "health", Health); //Match Mate's health with self's
setentityvar(self, 0, Mate); //Store mate to self
setentityvar(Mate, 0, self); //Store self to mate
}
takedamagescript that I combined with the blink script:
Code:
void main()
{// Equalize health with mate's health
void self = getlocalvar("self"); //Get calling entity
void Mate = getentityvar(self, 0); //Find Mate
void MateX = getentityproperty(Mate, "exists");
int Health = getentityproperty(self,"health");
if(Mate!=NULL() && MateX){
if(Health > 0){
changeentityproperty(Mate, "health", Health);
changeentityproperty(self, "colourmap", 1);
changeentityproperty(self, "maptime", 30 + openborvariant("elapsed_time"));
} else {
setentityvar(self, 0, NULL());
setentityvar(Mate, 0, NULL());
damageentity(Mate, self, 99999, 1, openborconstant("ATK_NORMAL"));
}
}
}

