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
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.
}