Control spawnbind entity without iBind 1,2 or 4

You really need to elaborate more cause your post and title don't tell enough of the situation :oops:.

So let's start by answering my questions :) to get good understanding:
1. You have a parent entity with some turrets attached to the former, right?
2. The parent spawns the turret with spawnbind function, right?
3. You want the parent to control the turret, at least its animation, right?
 
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?
1.Yeah, only one.
2.Yeah, the turret spawns once the parent does and stays there till death.
3.Yup, the parent to control the turret's animation(like attack) while allowing the parent to move around. (The name is Emain Macha)
I'm sorry, the initial post wasn't descriptive enough.
 
As long as they can identify each other via a parent child umm lets say relationship then they can munipulate each other without the need to ibind.
 
Ah, you could use these function set that I've coded for bosses in Contra fangame I've made years ago 😎:
C:
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);
      }
    }
}

I admit I wasn't consistent there 😅, Slave and Gun are the same thing here 😏.
Anyways, you need to use spawnGun function to spawn the turret. The last parameter is important cause that's where turret handle is stored in parent's entity variable.
anichangeSl is what you need to use next to control turret's animation. You need to input same number as one in spawnGun function.

I also shared killgun function to remove the turret.

HTH
 
Back
Top Bottom