spawnbind2 bug on new builds?

rafhot

Member
the behavior of spawnbind2 changed since the release of the new builds 4180 i think or maybe earlier

i use this function to make effects for my characters like beams and all kinds of projectile rays, but it started to hurt the caster and now they take damage from his own beam ray

it is a bug or its made to be this way?

i had to remove my bboxes in some moves that it happen because some beams are shared between bosses and playable versions of the bosses and have to be set as candamage player enemy

i just want to know it is intentional or it is a bug, to see the best way to fix it on my project
thanks

Code:
void spawnBind2(void Name, float dx, float dy, float dz, int Dir, int Flag)  //utilizado para beams e afins cyclops e outros
{ // Spawn entity and bind it
/*
@cmd spawnBind "Beam" 0 0 0 1 4

     The first 4 parameters are same as spawn01's . Parameter 2nd from last is to define Beam's facing direction relative to spawner, just set 1 if you want it to face same direction.
     Last parameter is what you need, you must set it to 4.

     By setting 4, engine will check if Beam and enemy's are in same animation or not. If not, Beam will be removed.

     So this also mean you need to change animation name from IDLE to ATTACK6 in Beam's text to match enemy's animation. If enemy is hit, his/her animation will change and won't match Beam's animation and will remove itself

*/
   void self = getlocalvar("self");
   void Spawn;

   Spawn = spawn01(Name, dx, dy, dz);
   bindentity(Spawn, self, dx, dz, dy, Dir, Flag);

}


void spawn01(void vName, float fX, float fY, float fZ)
{
	//spawn01 (Generic spawner)
	//Damon Vaughn Caskey
	//07/06/2007
	//
	//Spawns entity next to caller.
	//
	//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.
	void vSpawn; //Spawn object.
	int  iDirection = getentityproperty(self, "direction");

	clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

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

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
	
	vSpawn = spawn(); //Spawn in entity.

	changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
	changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
    
	return vSpawn; //Return spawn.
}


 
I don't know this bug.  BTW I didn't touch any code about it.  I think that is no bug. Use noreflect to solve your problem
 
yeah i already solved it but i noticed the changes in the last recent builds and reported just to check,  i notice too that all the binds stuff goes now behind the player it was in front the player on more older builds
 
I thinks there isn't a bug.
Your script has some errors for me.
First you need to bind dz+1 to spawn in front and no behind. Then you need to set the candidate flag to no take damage. Or an advance mode,  set a noreflect then in didhitscript avoid the spawner
 
and have to be set as candamage player enemy

Do you know you can set candamage on the fly, with script, right?

This is a code I did some time ago, so I can shoot projectiles with different can damage settings using the same entity:

void shooterCD(void Shot, void Can, float dx, float dy, float dz, float Vx, float Vy, float Vz, int Dir)

{ // Shooting projectile with speed control and CanDamage control
// Douglas Baldan - Based on Bloodbane's codes
  void self = getlocalvar("self");
  int Dire;
  int Direction = getentityproperty(self, "direction");
  int x = getentityproperty(self, "x");
  int y = getentityproperty(self, "a");
  int z = getentityproperty(self, "z");
  void vShot;

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

  vShot = projectile(Shot, x+dx, z+dz, y+dy, Dire, 0, 0, 0);
  changeentityproperty(vShot, "velocity", Vx, Vz, Vy);
  changeentityproperty(vShot, "speed", Vx);
  changeentityproperty(vShot, "candamage", Can);
}
 
Back
Top Bottom