projectile subject_to_hole ?

O Ilusionista

Captain 100K
I noticed that entities shoot using the projectile command can't be affected by subject_to_hole.
Its intentional or its a bug? because its very weird.

For example, projectiles shoot using this script won't be affect by subject_to_hole or wall
void shoot(void Shot, float dx, float dy, float dz)
{ // Shooting projectile
  void self = getlocalvar("self");
  int Direction = getentityproperty(self, "direction");
  int x = getentityproperty(self, "x");
  int y = getentityproperty(self, "a");
  int z = getentityproperty(self, "z");

  if (Direction == 0){ //Is entity facing left?                 
      dx = -dx; //Reverse X direction to match facing
  }

  projectile(Shot, x+dx, z+dz, y+dy, Direction, 0, 0, 0);
 
I solved this with a workaround, using other script that doesn't uses the projectile function.
Projectile just ignores the subject_to_hole & subject_to_wall

Shoot the projectile using "shooter2" function:

void shooter2(void Shot, float dx, float dy, float dz, float Vx, float Vy, float Vz)
{ // Shooting special projectile with speed control
  void self = getlocalvar("self");
  int Direction = getentityproperty(self, "direction");
  void vShot;

  if (Direction == 0){ //Is entity facing left?                 
      Vx = -Vx; //Reverse Vx direction to match facing
  }

  vShot = spawn01(Shot, dx, dy, dz);
  changeentityproperty(vShot, "velocity", Vx, Vz, Vy);
  changeentityproperty(vShot, "owner", self);
  return vShot;
}

You will need DC's spawn01 function as well
 
Back
Top Bottom