Cancel run jump - Using previous velocity

NED

Well-known member
I've updated my system to give new jump attacks using A2 button.
(This button is used for Hard Attacks)
Basically, it's a copiy of a generic jump attack, but used as a freespecial from jump anim (using cancel)

the move worked well, but how can I give it the initial jump velocity?
in vertical jump it's OK, but if you jump forward, x velocity is stopped...
Any way to fix it?

This is my code.

Code:
anim	jump
cancel 1 6 0 A2 freespecial14# jump hard kick
	subentity	dus
	summonframe	0 0
	loop	0
	offset	96 177
	bbox	75 95 45 89
	delay	5
	frame	data/chars/rachel/j02.gif
	bbox	76 65 40 78
	delay	10
	frame	data/chars/rachel/j02.gif
	delay	5
	frame	data/chars/rachel/j03.gif
	delay	15
	frame	data/chars/rachel/j04.gif
	delay	5
	frame	data/chars/rachel/j05.gif
	delay	40
	frame	data/chars/rachel/j06.gif

#anim	jumpattack
anim	freespecial14#Jump HARD KICK
	forcedirection	-1
	jugglecost	1
	offset	96 177
	bbox	70 70 44 64
	delay	7
	sound	data/sounds/a2.wav
	hitfx	data/sounds/beat2.wav
	sound	data/chars/rachel/kiai5.wav
	frame	data/chars/rachel/ja1.gif
	frame	data/chars/rachel/ja2.gif
	dropv	3 2.6#3
	delay	14#12
	bbox	60 70 70 58
	attack	80 100 89 43 15 1 0 0 19 0
	frame	data/chars/rachel/ja3.gif
	attack	0 0 0 0 0 0
	delay	11
	frame	data/chars/rachel/ja4.gif
	delay	8
	bbox	70 70 44 64
	frame	data/chars/rachel/j05.gif
	delay	40
	frame	data/chars/rachel/j06.gif
 
use this script, it's the one i use in order to fix your same problem:
Code:
void main()
{
    int iPlIndex = getlocalvar("player"); //Get calling player
    void vSelf = getplayerproperty(iPlIndex , "entity"); //Get calling entity
    void vAniID = getentityproperty(vSelf,"animationID"); //Get current animation ID
    void vAniPos = getentityproperty(vSelf, "animpos"); //Get current animation frame
    int iDir = getentityproperty(vSelf, "direction");  //Get current facing direction

    void iUp = playerkeys(iPlIndex, 1, "moveup"); // New key status of "Up"
    void iDown = playerkeys(iPlIndex, 1, "movedown"); // New key status of "Down"
    void iLeft = playerkeys(iPlIndex, 1, "moveleft"); // New key status of "Left"
    void iRight = playerkeys(iPlIndex, 1, "moveright"); // New key status of "Right"
    void iJump = playerkeys(iPlIndex, 1, "jump"); //New key status of "Jump"
    void iSpecial = playerkeys(iPlIndex, 1, "Special"); //New key status of "Special"
    void iAttack = playerkeys(iPlIndex, 1, "attack"); //New key status of "Attack"
    void iAttack2 = playerkeys(iPlIndex, 1, "attack2"); // New key status of "Attack 2"
    void iAttack3 = playerkeys(iPlIndex, 1, "attack3"); // New key status of "Attack 3"
    void iAttack4 = playerkeys(iPlIndex, 1, "attack4"); // New key status of "Attack 4"

    void iLeftR = playerkeys(iPlIndex, 2, "moveleft"); // Release status of "Left"
    void iRightR = playerkeys(iPlIndex, 2, "moveright"); // Release status of "Right"
    void iAttackR = playerkeys(iPlIndex, 2, "attack"); //Release status of "Attack"

    void iDownH = playerkeys(iPlIndex, 0, "movedown");
    void iUpH = playerkeys(iPlIndex, 0, "moveup");
    void iLeftH = playerkeys(iPlIndex, 0, "moveleft");
    void iRightH = playerkeys(iPlIndex, 0, "moveright");

//Mid-air attack
    if(vAniID == openborconstant("ANI_JUMP") || vAniID == openborconstant("ANI_FORWARDJUMP") || vAniID == openborconstant("ANI_RUNJUMP") ){ //Jumping?
      if (iAttack){ //Attack pressed?
        changeentityproperty(vSelf, "animation", openborconstant("ANI_JUMPATTACK"));
      } else if (iAttack2){ //Attack2 pressed?
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FREESPECIAL14"));
      }
    }

}

save it as key.c

then add the following line to your char's header:

Code:
keyscript				data/scripts/key.c
 
Ok,
Seems to work about the player movement.
But it create some problems.

1-I can't do one of my custom jump attack anymore :
freespecial16 a cancel from jump (Back + A)

2-every jump attack done with "A" button plays a sound from the regular "jumpattack"
for debugging and detecting it I given it a particular sound "Iku.wav" (see the code)

Is there a way to fix the problem?

My jump anims and moves:

Code:
anim	jump
cancel 1 6 0 A2 freespecial14# jump hard kick
cancel 1 6 0 B A freespecial16# jump back kick
	subentity	dus
	summonframe	0 0
	loop	0
	offset	96 177
	bbox	75 95 45 89
	delay	5
	frame	data/chars/rachel/j02.gif
	bbox	76 65 40 78
	delay	10
	frame	data/chars/rachel/j02.gif
	delay	5
	frame	data/chars/rachel/j03.gif
	delay	15
	frame	data/chars/rachel/j04.gif
	delay	5
	frame	data/chars/rachel/j05.gif
	delay	40
	frame	data/chars/rachel/j06.gif

anim	jumpattack
	forcedirection	-1
	jugglecost	1
	offset	96 177
	bbox	70 70 44 64
	delay	7
	sound	data/sounds/a2.wav
	hitfx	data/sounds/beat2.wav
	sound	data/chars/rachel/iku.wav#<------THIS SOUND FOR DEBUG!!
	frame	data/chars/rachel/ja1.gif
	frame	data/chars/rachel/ja2.gif
	dropv	3 2.6#3
	delay	14#12
	bbox	60 70 70 58
	attack	80 100 89 43 15 1 0 0 19 0
	frame	data/chars/rachel/ja3.gif
	attack	0 0 0 0 0 0
	delay	11
	frame	data/chars/rachel/ja4.gif
	delay	8
	bbox	70 70 44 64
	frame	data/chars/rachel/j05.gif
	delay	40
	frame	data/chars/rachel/j06.gif

#anim	jumpattack
anim	freespecial14#Jump HARD KICK
	forcedirection	-1
	jugglecost	1
	offset	96 177
	bbox	70 70 44 64
	delay	7
	sound	data/sounds/a2.wav
	hitfx	data/sounds/beat2.wav
	sound	data/chars/rachel/kiai5.wav
	frame	data/chars/rachel/ja1.gif
	frame	data/chars/rachel/ja2.gif
	dropv	3 2.6#3
	delay	14#12
	bbox	60 70 70 58
	attack	80 100 89 43 15 1 0 0 19 0
	frame	data/chars/rachel/ja3.gif
	attack	0 0 0 0 0 0
	delay	11
	frame	data/chars/rachel/ja4.gif
	delay	8
	bbox	70 70 44 64
	frame	data/chars/rachel/j05.gif
	delay	40
	frame	data/chars/rachel/j06.gif

anim	freespecial16#Jump back kick
#	jumpframe 0 0 2.8#7#pour continuer a avancer
	forcedirection	-1
	jugglecost	1
	offset	96 177
	bbox	82 65 48 71
	delay	7
	sound	data/sounds/a2.wav
	hitfx	data/sounds/knee.wav
	sound	data/chars/rachel/kiai3.wav
	frame	data/chars/rachel/jbak00.gif
	frame	data/chars/rachel/jbak00.gif
	dropv	3 -2.6#3
	delay	14#12
	bbox	60 70 70 58
	attack	31 103 70 48 15 0 0 0 20 0
	frame	data/chars/rachel/jbak01.gif
	attack	0 0 0 0 0 0
	delay	11
	frame	data/chars/rachel/jbak01.gif
	delay	8
	bbox	70 70 44 64
	frame	data/chars/rachel/jbak02.gif
	delay	40
	frame	data/chars/rachel/jbak02.gif

anim	jumpattack2
	forcedirection	-1
	jugglecost	1
	offset	96 177
	bbox	71 42 34 90
	delay	5
	sound	data/sounds/a2.wav
	hitfx	data/sounds/beat2.wav
	frame	data/chars/rachel/jad1.gif
	delay	9
	sound	data/chars/rachel/kiai3.wav
	frame	data/chars/rachel/jad2.gif
	attack2	84 66 69 74 12 0 0 0 22 0
	dropv	-4 2
	delay	8
	frame	data/chars/rachel/jad3.gif
	attack2	0 0 0 0 0 0
	delay	9
	frame	data/chars/rachel/jad4.gif
	delay	7
	bbox	70 70 44 64
	frame	data/chars/rachel/j05.gif
	delay	40
	frame	data/chars/rachel/j06.gif
 
Seems very complicated...
I'm thinking of using different animations for "jump" and "forwardjump"
So I can give velocity to the jump forward attacks

cancels from regular jump:
light attack
hard attack
jump - Back + A
jump - Down + A
(all these moves without x velocity)

cancels from jump forward:
light attack
hard attack
jump - Back + A
jump - Down + A
(all these moves WITH x velocity - by creating "copies" of them)

the problem with this method is there is no run jump specific animation, so I don't have any anim to cancel for these 2 new moves :
-run jump light attack
-run jump hard attack

Am I right about it? :-\


EDIT : I'll fix it, since runjump anim exists!  :)
 
Back
Top Bottom