Prior to this I have attack animation which does 3 attacks. I want to split it into 3 chained attack, if the previous one hits then continue next attack. Simply put, this is to solve not playing whole 3 attack animation unnecessary if prior one doesn't hit.
I did that by creating a new follow1, follow2, and follow3. First two follows are for 2nd attack and 3rd attack (if previous one hits) respectively. follow3 is for resting/final frames for attack animation.
In didhit script, I check the current frame number and if it hits, then I call performattack() for the next chained attack one. It seems to work, but the animation doesn't seem to update properly on screen although the logic hit box checking and sound playing are correct.
The following function taken from what I did currently (didhit script)
PS. those frame range checking is frames that has attack action in it, at least one of those frame has attack box inside. If you need more information, please feel free to let me know. Thanks.
Any hint on what might be the problem?
I did that by creating a new follow1, follow2, and follow3. First two follows are for 2nd attack and 3rd attack (if previous one hits) respectively. follow3 is for resting/final frames for attack animation.
In didhit script, I check the current frame number and if it hits, then I call performattack() for the next chained attack one. It seems to work, but the animation doesn't seem to update properly on screen although the logic hit box checking and sound playing are correct.
The following function taken from what I did currently (didhit script)
Code:
void docontinued_atk()
{
void self = getlocalvar("self");
void v_anim_id = getentityproperty(self, "animationID");
void frame = getentityproperty(self, "animpos");
// remember: it's already hit, so no need to query
// from "animhits"
if (v_anim_id == openborconstant("ANI_ATTACK1"))
{
log("in ANI_ATTACK1\n");
log("frame " + frame + "\n");
if (frame >= 12 && frame <= 14)
{
log("continue with ANI_FOLLOW1\n");
// follow up with another attack
performattack(self, openborconstant("ANI_FOLLOW1"));
}
}
else if (v_anim_id == openborconstant("ANI_FOLLOW1"))
{
log("in ANI_FOLLOW1\n");
if (frame >= 2 && frame <= 4)
{
log("continue with ANI_FOLLOW2\n");
// follow up with another attack
performattack(self, openborconstant("ANI_FOLLOW2"));
}
}
else if (v_anim_id == openborconstant("ANI_FOLLOW2"))
{
log("in ANI_FOLLOW2\n");
if (frame >= 2 && frame <= 4)
{
log("continue with ANI_FOLLOW3\n");
executeanimation(self, openborconstant("ANI_FOLLOW3"));
}
}
}
PS. those frame range checking is frames that has attack action in it, at least one of those frame has attack box inside. If you need more information, please feel free to let me know. Thanks.
Any hint on what might be the problem?