O Ilusionista
Captain 100K
I have some issue here and i can't fix it.
My char have an attack wich will "hold" the target with a net. To archive that, I gave it the "attack3" propriety and made a pain3 on the char, which will spawn the net effect.
Everything works fine, unless a big problem: I can keep hitting the enemy with the same attack, over and over, and this is not cool.
So, I need to make a script to check if my entity (a projectile) to check its target anim. If the target is on "pain3", it should change the target anim to "ANI_FALL" (or change his propriety to "attack", not "attack3 anymore).
In other words: target (which is in pain3 animation) should be able to be hit by everything, MINUS an "attack3". If you use an attack3, it should go to its "fall" animation.
I made a didhitscript with this:
But it doesn't works. I don't want to set a takedamagescript for every single entity on my game.
how I do that?
My char have an attack wich will "hold" the target with a net. To archive that, I gave it the "attack3" propriety and made a pain3 on the char, which will spawn the net effect.
Everything works fine, unless a big problem: I can keep hitting the enemy with the same attack, over and over, and this is not cool.
So, I need to make a script to check if my entity (a projectile) to check its target anim. If the target is on "pain3", it should change the target anim to "ANI_FALL" (or change his propriety to "attack", not "attack3 anymore).
In other words: target (which is in pain3 animation) should be able to be hit by everything, MINUS an "attack3". If you use an attack3, it should go to its "fall" animation.
I made a didhitscript with this:
Code:
void main()
{// Anti loop
void self = getlocalvar("self"); //Get calling entity.
void target = getlocalvar("Target" + self);
if(target==NULL())
{
target = getentityproperty(self, "opponent");
setlocalvar("Target" + self, target);
}
if(target!=NULL() && target==openborconstant("ANI_PAIN3"))
{
changeentityproperty(target, "animation", openborconstant("ANI_FALL")) ;
}
}
But it doesn't works. I don't want to set a takedamagescript for every single entity on my game.
how I do that?