cancel with imput only on hit (FIXED)

NED

Well-known member
I'm working in some throw cancel from a normal kick hit only in stand enemies (using grabcheckG to detect if enemy is standing, in air...)

o2d9.jpg


This is how the move works :
-kick (low blow) is a command move done by "D A2"
-On hit you can tap "A2" or perhaps "F A2" to start a slam attempt
-On success the slam is done / on miss it plays kick recovery anim.

It seems to work well, but I would it to work only when the kick clean hits (not blocked)

-How to fix it so the cancel is possible only when kick hits.
1 detail that could help this kick send to a special pain anim (pain4)

-Also, a second bug happens. When the kick kills, the slam make enemy play death voice multiple time.
So I would like the cancel to be possible only if close enemy is alive.

Is this possible?

This is the code:

KICK
Code:
#anim slide	# low blow
anim	freespecial13

cancel 4 5 1 A2 freespecial58#F A2 freespecial42# DIAMOND DUST cancel (temp)----------------------------

cancel 4 5 1 D F A2 freespecial31#super moves
cancel 4 5 1 D U A2 freespecial46#super moves

cancel 4 5 1 D U A freespecial4# hard attacks vers coups speciaux
cancel 4 5 1 D F A freespecial2# hard attacks vers coups speciaux
cancel 4 5 1 F D A freespecial1# hard attacks vers coups speciaux

	damageonlanding 0 1#l'enemi peut faire des indirect damage
	delay	11###9#8
	loop	0
	forcedirection	-1
	jugglecost	1
	offset	96 177
	bbox	76 80 56 102
	frame	data/chars/rachel/ga1.gif
	delay	6###5
	sound	data/chars/rachel/rhora.wav
	frame	data/chars/rachel/ga3.gif
	delay	6###5
	sound	data/sounds/a2.wav
	frame	data/chars/rachel/gat1.gif
	delay	14#14#9
	hitfx	data/sounds/knee.wav
####	attack4	108 112 72 47 18 0 0 0 26 0
	attack4	108 112 60 47 18 0 0 0 26 0
	otg 1# HIT ON THE GROUND
	dropv	2.2 2.8
	frame	data/chars/rachel/lowblow1.gif
	delay	11#12
	attack4	0 0 0 0 0 0
	frame	data/chars/rachel/lowblow2.gif
	delay	6
	frame	data/chars/rachel/gat6.gif
	delay	10
	frame	data/chars/rachel/ga3.gif

Throw attempt
Code:
#ATTEMPT CHECK (use slam scripts) - DIAMOND DUST attempt (from low blow)
#1-grab air enemy/2-if moto 3-if/non ground enemy.
anim freespecial58
      loop	0
drawmethod 256 256 0 0 0 4#foncé debug#-----------------------
	delay	1
	offset	96 177
	bbox	76 80 56 102

	delay	11#12
	frame	data/chars/rachel/lowblow2.gif
	delay	6
      @cmd    grabcheckG "ANI_FOLLOW25" "ANI_FOLLOW24" "ANI_FOLLOW24"
	frame	data/chars/rachel/gat6.gif
	delay	10
	frame	data/chars/rachel/ga3.gif

Throw miss
Code:
#DIAMOND DUST miss 
anim follow24
      loop	0
drawmethod 256 256 0 0 0 1#plus clair debug#-----------------------
	delay	1
	offset	96 177
	bbox	76 80 56 102

#	delay	11#12
#	frame	data/chars/rachel/lowblow2.gif
	delay	6
	frame	data/chars/rachel/gat6.gif
	delay	10
	frame	data/chars/rachel/ga3.gif

Throw success
Code:
anim	follow25# DIAMOND DUST success
	flipframe	19# frame+1 ou on se retourne (en X)
      hitfx   data/sounds/indirect.wav
	jumpframe	2 3.4 2.8#2 3 2.8#2 3.5 3.5#{frame} {speedy} {speedx} {speedz} {dust} 
	landframe	6 dus#6#13#12
	attackone 0#1#0
	quakeframe 6 9 7#13 9 7#3

	subentity	flashshort
	spawnframe	6 -20 3 60 0#6 0 3 8 0#{frame} {x} {z} {a} {relative}

	 offset	96 177
	 bbox		0 0 0 0
#	 hitfx   	data/sounds/empty.wav


	 delay      18#6
        @cmd    slamstart
        @cmd    position 0 30 0 0 1
       frame      data/chars/rachel/grab.gif#franke00.gif

	 delay      9
#        @cmd    slamstart
        @cmd    position 0 20 0 0 1
	sound	data/chars/rachel/kiai5.wav
       frame      data/chars/rachel/bttdri1.gif

	 delay      9
        @cmd    position 11 -15 -25 0 1#0 0 0 0 1
       frame      data/chars/rachel/diamdust00.gif

	 delay      9
        @cmd    position 11 -35 -60 0 1
	attack	77 66 58 80 5 1 1 0 6 20
       frame      data/chars/rachel/diamdust01.gif

        @cmd    position 11 -35 -50 0 1
	attack	77 66 58 80 5 1 1 0 6 20
       frame      data/chars/rachel/diamdust02.gif

	 delay      -1000
        @cmd    position 11 -35 -30 0 1
	attack	69 98 71 81 40 1 1 0 6 20
       frame      data/chars/rachel/diamdust03.gif# flying

	 delay      1#9-------1 frame pour le 2eme son (hitsound)
#	@cmd spawn01 "slmfxfst" 0 0 -3#--name x y z--(en arr plan)
        @cmd    position 12 -50 8 0 1
	attack	69 98 71 81 40 1 1 0 6 20
#	@cmd spawn01 "bldcrsh" 0 7 5#--name x y z--
       frame      data/chars/rachel/diamdust04.gif# hitground

	 delay      1#1#9-------1 frame pour le 2eme son (hitsound)
	sound	data/sounds/fall.wav#fallcrsh.wav#fall.wav
        @cmd    position 12 -50 8 0 1
	attack	0 0 0 0
       frame      data/chars/rachel/diamdust04.gif

	 delay      8#1#12#20#30#1#7#5-------1 frame pour le 2eme son (hitsound)
	sound	data/sounds/strangle2.wav#powhitt.wav#mountdrop.wav#beat2.wav#hardp.wav
        @cmd    position 12 -50 8 0 1
       frame      data/chars/rachel/diamdust04.gif

	 delay      1#7#5--------------last pour release bind of P2 (1 frame)
	sound	data/sounds/snap1.wav
        @cmd    position 12 -44 1 0 1
       frame      data/chars/rachel/diamdust05.gif


	 delay      1#7#5--------------last pour release bind of P2 (1 frame)
        @cmd    depost 0
        @cmd    finish 30 1 -0.3 1.5 -0.1 1#55 2 1 1.5 0 1#  dam fall-type x y z direction
       frame      data/chars/rachel/diamdust05.gif


	 delay      13#9
@cmd leaper 1.1 1.7 0#1.5 2 0#1.5 2.8 0#----------(x y z)gooood script pour un 2eme hop possible
       frame      data/chars/rachel/diamdust05.gif

	 delay      9#13#9
       frame      data/chars/rachel/diamdust05.gif

	 delay      13#9#13#9
       frame      data/chars/rachel/diamdust05b.gif

	 delay      9#10#13#9
       frame      data/chars/rachel/diamdust06.gif

	 delay      7#9#13#9
       frame      data/chars/rachel/diamdust07.gif

	 delay      16#18#25#13#9
       frame      data/chars/rachel/diamdust08.gif

	 delay      9#10
	frame	data/chars/rachel/diamdust09.gif
	frame	data/chars/rachel/diamdust10.gif

	frame	data/chars/rachel/j01.gif

Basically, what I need is a use of both "followanim followcond" and "cancel"
-"Cancel" allows "sequence of inputs" and number f "hits", but don't detect if enemy is guarding.
-"followcond" allows "kill enemy detect" and "move guarded detect", but can't be triggered by an imput.

AFAIK there is no regular way to do it. Perhaps I've a bad reading of Openbor manual. :-\
 
I think you need this script or similar.

Usage
Code:
ani0020 openborconstant("ANI_ATTACK11") openborconstant("ANI_PAIN11")

It will only perform the attack if the enemy is in the right animation and in range, you can change to different animation types.


ani0020.h
Code:
#include "data/scripts/ani0009.h"

int ani0020(int iAni, int iTAni){
    
	/*
	ani0020
	Damon Vaughn Caskey
	Perform alternate animation if target is within range and in specified animation.

	iAni:	Alternate attack.
	iTAni:	Target animation.
	*/

    void vSelf      = getlocalvar("self");					//Caller.                                                         
    void vOpp       = findtarget(vSelf, iAni);				//Nearest target in range of alternate attack.
	
	if (vOpp)												//Found a target?
	{
		if(getentityproperty(vOpp, "animationID") == iTAni)	//Animation match?
		{
			ani0009(vSelf, iAni, 0);						//Perform alternate attack.
			return 1;										//Return 1.
		}
	}

	return 0;												//Return 0.
}

ani0009.h
Code:
int ani0009(void vTarget, int iAni, int iType)
{
    //Set animation and return 1 if valid.

	if (!vTarget) vTarget = getlocalvar("self");

    if (getentityproperty(vTarget, "animvalid", iAni))          //Animation valid?
    {
        if (iType == -1)                                        //Type -1?
        {
            changeentityproperty(vTarget, "animation", iAni);   //Set animation with entity property.
        }
        else
        {
            performattack(vTarget, iAni, iType);                //Set animation with perform attack command.
        }
        return 1;                                               //Return 1.        
    }
    return 0;
}

 
Thanks BeasTie,
This is what I need.
It should work since the starter have a particular pain anim caused by this move.

I'll try that.

EDIT-------
I tried to ad the line in header to declare ani0020, but it crashes.
Is it OK to have multiple "animationscript" in character header?

like that...

Code:
animationscript data/scripts/slam.c
animationscript data/scripts/ani0020.h

EDIT 2-------
Nevemind, it worked perfectly!
I added "ani0020.h" content to my regular script file.

So, I applied it this way (if someone need this kind of move in the future)

-Kick hits
-cancel with an imput
-DC's "ani0020.h" to check enemy's anim (pain4)
-on success go to BB's checker to check enemy's "state" (stand)
-on success go to the slam itself

Thanks again, BeasTie!!
 
Back
Top Bottom