Weird "Infinite Run Jump Attack Combo" bug?

Hello there, fellow developers!

I'm facing a weird bug, related to a RunJumpAttack with animfollow.

Here's the code:
Code:
anim	runjumpattack

	followanim	1
	followcond	1
	loop	1 2
	delay	5
	offset	32 62
	bbox	22 30 20 33

	frame	data/chars/sonic/runjumpattack_00.png
	frame	data/chars/sonic/runjumpattack_01.png

	attack.position.x		34
	attack.position.y		39
	attack.size.x			24
	attack.size.y			16
	attack.damage.force		10
	attack.reaction.pause.time	10
	attack.reaction.fall.force	50
	attack.reaction.fall.velocity.x	01
	attack.reaction.fall.velocity.y	01
	attack.reaction.pause.time	10

	@cmd	dash	4
	frame	data/chars/sonic/runjumpattack_02.png
	frame	data/chars/sonic/runjumpattack_03.png
	frame	data/chars/sonic/runjumpattack_04.png
	frame	data/chars/sonic/runjumpattack_05.png

anim	follow
	loop	1 2
	delay	5
	offset	32 62
	bbox	22 30 20 33

	@cmd	dash 0 0
	attack	0
	frame	data/chars/sonic/runjumpattack_06.png
	@cmd	dash 1 1
	frame	data/chars/sonic/runjumpattack_07.png

	frame	data/chars/sonic/runjumpattack_08.png
	frame	data/chars/sonic/runjumpattack_09.png

As you guys may see, the RunJumpAttack is automatically interrupted after hitting an enemy, and the character bounces back. So far, so good, ok?
The issue is: after hitting an enemy, in the "follow" animation, if the player presses the attack button, the RunJumpAttack happens again, leading to a possible infinte "hit 'n bounce back" air combo.

As fun as it sounds, this is an unintended thing that i would like to get rid of. How should I proceed?
 
I've checked it and managed to reproduce the bug

The real cause of the bug is air cancel. By default, players can cancel jump attack to jump attack2 and vice versa. You can set noaircancel in models.txt to disable air cancel

If you want to disable air cancel in certain moves only such as runjumpattack, you can add this script:
Code:
anim runjumpattack
@script
  if(frame==1){
    void self = getlocalvar("self");
    changeentityproperty(self, "aiflag", "jumping", 0);
  }
@end_script
...

The script will disable jumping status and thus disable air cancel in this move and in its followup
 
Back
Top Bottom