NONAME01150
New member
Is there a way to make the entity(turret) go to another anim without interrupting the parent?
1. You have a parent entity with some turrets attached to the former, right?
2. The parent spawns the turret with [I]spawnbind[/I] function, right?
3. You want the parent to control the turret, at least its animation, right?
void spawnGun(void Name, float dx, float dy, float dz, int Num)
{ // Spawn gun, store it and bind it
void self = getlocalvar("self");
void Spawn;
Spawn = spawn01(Name, dx, dy, 0);
setentityvar(self, Num, Spawn); // Stores spawned gun to be killed later
bindentity(Spawn, self, dx, dz, dy, 0, 0); // Bind spawned gun
}
void anichangeSl(int Num, void Ani)
{// Change Slave's animation
// Num = Slave number
// Ani = Desired animation
void self = getlocalvar("self");
void Slave = getentityvar(self, Num);
changeentityproperty(Slave, "animation", openborconstant(Ani));
}
void killgun(int Num, int Flag)
{ // Kill bound gun based on number
void self = getlocalvar("self");
void Gun = getentityvar(self, Num);
if(Gun!=NULL()){
bindentity(Gun, NULL());
if(Flag==1){
damageentity(Gun, self, 1000, 0, openborconstant("ATK_NORMAL"));
} else {
killentity(Gun);
}
}
}