I get an error when I use cancellation

What should I do?

Code:
anim	freespecial10
	jumpframe	7 5 5
	quakeframe	11 1 20
	movea	0
	offset	100 185
	bbox	62 13 79 172
	delay	10
	hitfx	data/sounds/sphit1.wav
	delay	5
	frame	data/chars/kuma/n3.gif
	frame	data/chars/kuma/dp1.gif
	frame	data/chars/kuma/dp2.gif
	frame	data/chars/kuma/dp3.gif
	frame	data/chars/kuma/dp4.gif
	frame	data/chars/kuma/dp5.gif
	frame	data/chars/kuma/dp6.gif
	frame	data/chars/kuma/dp7.gif
	attack	150 80 59 75 30 50 0 0 50 50
	offset	100 115
	bbox	9 52 191 96
	delay	80
	sound	data/sounds/punch.wav
	frame	data/chars/kuma/dp8.gif
	attack	0 0 0 0 0 0 0 0 0 0
	delay	10
	frame	data/chars/kuma/dp8.gif
	frame	data/chars/kuma/dp8.gif
	sound	data/sounds/fall.wav
	frame	data/chars/kuma/dp8.gif
	frame	data/chars/kuma/dp8.gif
	frame	data/chars/kuma/dp8.gif
	offset	100 185
	bbox	62 13 79 172
	delay	10
	frame	data/chars/kuma/hri4.gif
	frame	data/chars/kuma/hri3.gif
	frame	data/chars/kuma/hri2.gif
	frame	data/chars/kuma/hri1.gif

Code:
anim	attack4
	Cancel	0 10 1 D+F A"freespecial10"
	loop	0
	delay	8
	offset	100 175
	bbox	62 13 79 172
	custknife	kuma_ef4
	throwframe	0 3
	frame	data/chars/kuma/n2.gif
	offset	99 181
	bbox	59 15 79 170
	frame	data/chars/kuma/p41.gif
	frame	data/chars/kuma/p42.gif
	offset	111 180
	blast	110 60 110 100 10 10 0 0 0 20
	frame	data/chars/kuma/p43.gif
	frame	data/chars/kuma/p42.gif
	frame	data/chars/kuma/p41.gif
 
Since the very beginning of this topic, something's been telling me you need script for creating diagonals with an attack. But at time, I wasn't sure you would need it. Now that you mention it, I was right all along. I don't think you will need to cancel for freespecial at all.

Damon Caskey did a diagonal control script though I modified it a little for adding a special button input.

You can copy this file for your own and save it in your scripts folder as diagonal_attack.c:

Code:
void main()
{
    void target;        // Target entity for action.
    int player_index;   // Player index triggering event.
	int attack_press;	// Attack key press for action
    void animation_id;
       
    // Key status.
    int key_hold;
    int key_forward;
   
    // Get the player index and target entity.
    player_index    = getlocalvar("player");
    target          = getplayerproperty(player_index, "entity");   
	attack_press	= playerkeys(player_index, 1, "attack");
	animation_id	= getentityproperty(player_index, "animationid");
   
    // Get key hold status.
    key_hold    = getplayerproperty(player_index, "keys");   
   
    // Holding the down key during a certain animation for a cancel?
	if(animation_id == "ANI_ATTACK4"){
		if(key_hold & openborconstant("FLAG_MOVEDOWN"))
		{
			// Check to see if current hold key has a forward match.
			key_forward = dc_check_key_forward(key_hold, target);
   
			if(key_forward)
			{
				if(attack_press){
					performattack(target, openborconstant("ANI_FREESPECIAL10"));
				}
			}
		}
	}
}
       
// Caskey, Damon V.
// 2018-08-13
//
// Return true if key status includes a "forward"
// direction key in relation to target entity facing.
int dc_check_key_forward(int key_status, void target)
{
    int result;
    void direction;
   
    // Default false.
    result = 0;
   
    // Which direction are we facing?
    direction = getentityproperty(target, "direction");
   
    // Facing right?
    if(direction == openborconstant("DIRECTION_RIGHT"))
    {
        // Does the current key status contain a match
        // to the right direction key? If so result is true.
        if(key_status & openborconstant("FLAG_MOVERIGHT"))
        {
            result = 1;
        }       
    }
    else
    {
        // Same as above, but for left.
        if(key_status & openborconstant("FLAG_MOVELEFT"))
        {
            result = 1;
        }
    }
   
    return result;
}

Note: The script I put here is only for pressing attack button with diagonal down-forward during a certain animation you want to use.

EDIT: I forgot to say that you put the script in the header for your character here.

Code:
script data/scripts/diagonal_attack.c
 
Back
Top Bottom