mersox
Active member
Hi all. I'm having trouble scripting an attack. Basically, it's a basic attack that, at the start, checks the enemy's playing animation. If the enemy is currently in "FOLLOW4" (stunned animation), the player's attack switches to a different move (uppercut).
The script works when dealing with only one enemy. But then the player is attacking multiple enemies at the same time, the uppercut is never triggered. I suspect it's because the script doesn't know which entity to consider the "opp" and thus doesn't return any variable when checking (or something along those lines).
Here's the script:
The script works when dealing with only one enemy. But then the player is attacking multiple enemies at the same time, the uppercut is never triggered. I suspect it's because the script doesn't know which entity to consider the "opp" and thus doesn't return any variable when checking (or something along those lines).
Here's the script:
anim attack2
@script
void self = getlocalvar("self");
void opp = getentityproperty(self,"opponent");
void animID = getentityproperty(opp, "animationid");
if ((frame == 0 ) && (animID == openborconstant("ANI_FOLLOW4")) )
{
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"));
}
@end_script
loop 0
delay 5
offset 63 112
bbox 53 71 21 41
delay 10
frame data/chars/player/punch3.png
attack 55 75 30 16 2 0 0 0 15
frame data/chars/player/punch4.png
attack 0 0 0 0
frame data/chars/player/punch3.png