runjump and freespecial

jonsilva

New member
hello
i trying to use a freespecial on the runjump animation
but the player jump stops in air once the freescpecial starts
i wanted to make it move forward using the previous velocity x from the runjump
is there a way to attain the player/entity previous x velocity
void leap(float Vely)
{// Leap with previously attained speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");
  float Vx = getentityproperty(self,"velocity");


//    float Vx = getlocalvar("x"+self);
//    float Vz = getlocalvar("z"+self);
//  if(dir==0){ // Facing left?
//    Vx = -Vx ;
//  }

    tossentity(self, Vely, Vx); //Leap towards target!
}

the script above doesnt seem to work...
 
The problem with cancel command is that it stops x movement.

You could store velocity while still in runjump animation and reuse it in later animation, or use a custom velocity in later animation.

But, personally I use a custom cancel system (via keyscript), that way x movement isn't stopped in the first place.
 
i got it working that way
void airgo()
{// Leap with previously attained speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

float Vy = getentityvar(self, 6); //velocity x
float Vx = getentityvar(self, 5); //velocity x

    if(dir==0){ // Facing left?
      Vx = -Vx ;
    }
    tossentity(self, Vy, Vx); //Move!
}

in player runjump animation
anim runjump
@script
void self = getlocalvar("self");
setentityvar(self, 5, 4);
setentityvar(self, 6, 4);
@end_script
loop 0
delay 6
offset 100 189
bbox 79 95 50 50
cancel 5 20 0 s freespecial20
frame data/chars/3mrkarate/fall15.gif
frame data/chars/3mrkarate/fall13.gif
frame data/chars/3mrkarate/fall12.gif
frame data/chars/3mrkarate/fall11.gif
frame data/chars/3mrkarate/fall10.gif

thanks
(iam not sure if there was a way to get entity current velocity.x)
 
yes but you would need equal animations attacks with diferent jumpframes
iam using the script for air slams
it plays an air attack that goes to follow and the follow makes the @slamstart
so it would need 3 of each attacks and follows...
for anim jump/ jumpfoward and runjump

...also using jumpframe or @cmd leaper on a jump anim makes the player lose the jump altitude velocity setting the
setentityvar(self, 6, 0); //velocity up
to zero makes the entity use the the jump anim altitude velocity like in ani normal jumpattack

heres a preview of the air grabs
http://youtu.be/UskVEW4HWzQ?list=UUrm294XWVzDEqKHpYF45Kmw
 
i still dont know if it will work 100%
it could be a problem of the engine creating
ten or twenty diferent entityvars name 5 instead of overwriting entityvar 5 with a new jump value

heres an example of how iam using it together with all the jump combos
----air slam----
anim freespecial20
loop 0
delay 2
offset 100 189
bbox 0 0 0 0
@cmd airgo
followanim 2
followcond 1
landframe 5
hitfx data/sounds/grab.wav
attack 0 0 0 0
frame data/chars/3mrkarate/6grab01.gif
delay 35
attack10 90 85 65 40 0 1 1 1 25 20
dropv 3 0
frame data/chars/3mrkarate/6grab01.gif
attack10 0 0 0 0
delay 7
frame data/chars/3mrkarate/jump05.gif
@cmd anichange "ANI_JUMP"
frame data/chars/3mrkarate/jump05.gif
delay 500
frame data/chars/3mrkarate/jump05.gif
delay 12
frame data/chars/3mrkarate/rise4.gif

----------------------------//--------------------------

anim follow2
loop 0
delay 20
offset 100 189
bbox 0 0 0 0
@cmd airgo
landframe 3 dust
@cmd slamstart2
@cmd position 5 50 70 -1 -1
frame data/chars/3mrkarate/6grab01.gif
delay 15
@cmd position 1 15 95 -1 -1
frame data/chars/3mrkarate/6grab02.gif
@cmd airgo -2
delay 350
@cmd position 14 40 70 1 -1
frame data/chars/3mrkarate/6grab03.gif
delay 15
@cmd position 15 40 40 1 -1
frame data/chars/3mrkarate/6grab04.gif
@cmd spawn01 "qfx" 60 1 1
@cmd position 14 40 50 1 -1
frame data/chars/3mrkarate/6grab05.gif
@cmd depost 0
@cmd finish 55 1 -1 5 0 0
frame data/chars/3mrkarate/6grab06.gif
frame data/chars/3mrkarate/6grab07.gif
frame data/chars/3mrkarate/6grab08.gif

air pile driver
anim freespecial21
loop 0
delay 2
offset 100 189
bbox 0 0 0 0
@cmd airgo
followanim 4
followcond 1
landframe 5
hitfx data/sounds/grab.wav
attack 0 0 0 0
frame data/chars/3mrkarate/6grab01.gif
delay 35
attack10 90 85 65 40 0 1 1 1 25 20
dropv 3 0
frame data/chars/3mrkarate/6grab01.gif
attack10 0 0 0 0
delay 7
frame data/chars/3mrkarate/jump05.gif
@cmd anichange "ANI_JUMP"
frame data/chars/3mrkarate/jump05.gif
delay 500
frame data/chars/3mrkarate/jump05.gif
delay 12
frame data/chars/3mrkarate/rise4.gif

---------------------//------------------------------


anim follow4
loop 0
delay 20
offset 100 185
bbox 0 0 0 0
@cmd airgo
landframe 4 dust
@cmd slamstart2
@cmd position 12 30 80 -1 1
frame data/chars/3mrkarate/4grab07.gif
delay 15
offset 110 170
@cmd position 3 30 60 -1 1
frame data/chars/3mrkarate/4grab08.gif
offset 115 171
@cmd position 15 10 50 -1 -1
frame data/chars/3mrkarate/4grab10.gif
delay 300
@cmd position 14 10 50 -1 -1
frame data/chars/3mrkarate/4grab11.gif
delay 12
@cmd spawn01 "qfx" 40 1 1
@cmd position 15 10 50 -1 -1
frame data/chars/3mrkarate/4grab12.gif #4
@cmd position 14 10 50 -1 -1
frame data/chars/3mrkarate/4grab13.gif
@cmd depost 0
@cmd finish 55 1 -1 5 0 0
delay 8
offset 115 160
frame data/chars/3mrkarate/4grab12.gif
frame data/chars/3mrkarate/4grab13.gif
offset 100 189
frame data/chars/3mrkarate/rise1.gif
frame data/chars/3mrkarate/rise2.gif
frame data/chars/3mrkarate/rise3.gif
frame data/chars/3mrkarate/rise4.gif

runjump
anim runjump
@script
void self = getlocalvar("self");
setentityvar(self, 5, 4); x velocity
setentityvar(self, 6, 0); y velocity

@end_script
loop 0
delay 6
offset 100 189
bbox 79 95 50 50
cancel 5 20 0 s freespecial20
cancel 5 20 0 d s freespecial21
frame data/chars/3mrkarate/fall15.gif
frame data/chars/3mrkarate/fall13.gif
frame data/chars/3mrkarate/fall12.gif
frame data/chars/3mrkarate/fall11.gif
frame data/chars/3mrkarate/fall10.gif
delay 2
frame data/chars/3mrkarate/jump02.gif #5
frame data/chars/3mrkarate/jump02.gif
frame data/chars/3mrkarate/jump02.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif #20

uppercutcombo
anim freespecial4
@script
void self = getlocalvar("self");
setentityvar(self, 5, 2); x velocity
setentityvar(self, 6, 1); y velocity

@end_script
energycost 15
mponly 1
cancel 9 25 0 a freespecial5
cancel 9 25 0 s freespecial20
cancel 9 25 0 d s freespecial21
loop 0
delay 6
offset 100 189
bbox 0 0 0 0
fastattack 1
forcedirection -1
jumpframe 3 4 2
landframe 26 dust
hitfx data/sounds/beat4.wav
frame data/chars/3mrkarate/upper01.gif
frame data/chars/3mrkarate/upper02.gif
attack10 90 55 65 90 25 1 0 0 30 20
dropv 2 2
frame data/chars/3mrkarate/upper03.gif
attack10 0 0 0 0
frame data/chars/3mrkarate/upper04.gif
delay 15
attack10 90 35 70 100 35 1 0 0 30 20
dropv 5 1
frame data/chars/3mrkarate/upper04.gif
delay 7
frame data/chars/3mrkarate/upper05.gif
frame data/chars/3mrkarate/upper06.gif
frame data/chars/3mrkarate/upper07.gif
frame data/chars/3mrkarate/upper08.gif
attack10 0 0 0 0
frame data/chars/3mrkarate/upper09.gif
delay 2
frame data/chars/3mrkarate/upper09.gif #10
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif #25
delay 9
frame data/chars/3mrkarate/rise3.gif #26
frame data/chars/3mrkarate/rise4.gif

--------------------------//-------------------------------------

anim freespecial5
@script
void self = getlocalvar("self");
setentityvar(self, 5, 2); x velocity
setentityvar(self, 6, 1); y velocity

@end_script
cancel 9 24 0 a freespecial6
cancel 9 24 0 s freespecial20
cancel 9 24 0 d s freespecial21
loop 0
delay 6
offset 100 189
bbox 0 0 0 0
jumpframe 0 3 1
landframe 25 dust
fastattack 1
forcedirection -1
hitfx data/sounds/beat5.wav
@cmd spawnbind2 "pw13a" 40 5 1 "ANI_FOLLOW5"
attack10 0 0 0 0
frame data/chars/3mrkarate/upper09.gif
attack10 90 55 70 80 5 1 0 0 30 20
dropv 2 1
@cmd leaper 1 1
frame data/chars/3mrkarate/upper10.gif
sound data/sounds/burn.wav
attack10 0 0 0 0
@cmd leaper 1 1
frame data/chars/3mrkarate/upper10.gif
delay 15
attack10 90 35 70 100 35 1 0 0 30 20
dropv 3 1
@cmd leaper 1 1
frame data/chars/3mrkarate/upper04.gif
delay 6
@cmd leaper 1 1
frame data/chars/3mrkarate/upper05.gif
@cmd leaper 1 1
frame data/chars/3mrkarate/upper06.gif
@cmd leaper 1 1
frame data/chars/3mrkarate/upper07.gif
frame data/chars/3mrkarate/upper08.gif
attack10 0 0 0 0
frame data/chars/3mrkarate/upper09.gif
delay 2
frame data/chars/3mrkarate/upper09.gif #9
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif #24
delay 9
frame data/chars/3mrkarate/rise3.gif #25
frame data/chars/3mrkarate/rise4.gif

--------------------------------//-----------------------------

anim freespecial6
@script
void self = getlocalvar("self");
setentityvar(self, 5, 2); x velocity
setentityvar(self, 6, 1); y velocity

@end_script
cancel 9 24 0 a freespecial8
cancel 9 24 0 s freespecial20
cancel 9 24 0 d s freespecial21
loop 0
delay 6
offset 100 189
bbox 0 0 0 0
jumpframe 0 3 1
landframe 25 dust
fastattack 1
forcedirection -1
hitfx data/sounds/beat5.wav
@cmd spawnbind2 "pw13a" 40 5 1 "ANI_FOLLOW5"
attack10 0 0 0 0
frame data/chars/3mrkarate/upper09.gif
attack10 90 55 70 80 5 1 0 0 30 20
dropv 2 1
@cmd leaper 1 1
frame data/chars/3mrkarate/upper10.gif
sound data/sounds/burn.wav
attack10 0 0 0 0
@cmd leaper 1 1
frame data/chars/3mrkarate/upper10.gif
delay 15
attack10 90 35 70 100 35 1 0 0 30 20
dropv 3 1
@cmd leaper 1 1
frame data/chars/3mrkarate/upper04.gif
delay 6
@cmd leaper 1 1
frame data/chars/3mrkarate/upper05.gif
@cmd leaper 1 1
frame data/chars/3mrkarate/upper06.gif
@cmd leaper 1 1
frame data/chars/3mrkarate/upper07.gif
frame data/chars/3mrkarate/upper08.gif
attack10 0 0 0 0
frame data/chars/3mrkarate/upper09.gif
delay 2
frame data/chars/3mrkarate/upper09.gif #9
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif
frame data/chars/3mrkarate/upper09.gif #24
delay 9
frame data/chars/3mrkarate/rise3.gif #25
frame data/chars/3mrkarate/rise4.gif

ive also changed the script
void airgo(float Vely)
{// Leap with previously attained speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

float Vx = getentityvar(self, 5); //velocity x

    if(dir==0){ // Facing left?
      Vx = -Vx ;
    }
    tossentity(self, Vely, Vx); //Move!
}

this way it works like
anim follow2
loop 0
delay 20
offset 100 189
bbox 0 0 0 0
@cmd airgo 3
landframe 3 dust
@cmd slamstart2
@cmd position 5 50 70 -1 -1
frame data/chars/3mrkarate/6grab01.gif
---//----------
the jump y velocity is set in the slam animation but this way it only uses entityvar 5 for x velocity... its impossible to change y velocity latter...
(the script in the post above could better)
 
I believe you need to acquire current velocities with these:
Code:
      void self = getlocalvar("self");

      int Vx = getentityproperty(self, "xdir");
      int Vy = getentityproperty(self, "tossv");
      int Vz = getentityproperty(self, "zdir");

just use the ones you need though :)
Then store the acquire velocities in entity variables you are using now

HTH
 
only...
int Vy = getentityproperty(self, "tossv");
seems to work...
in the script below using tossv as x velocity the player moves faster or slow
depending on the jump current velocity in altitude
(if you press the freespecial immediately after jump it moves faster)
void airgo(float Vely)
{// Leap with previously attained speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

float Vx = getentityproperty(self, "tossv");

    if(dir==0){ // Facing left?
      Vx = -Vx ;
    }
    tossentity(self, Vely, Vx); //Move!
}
the problem here could be finding the right word for the current velocity in x (if such command exist)
ive already tried using velocity.x/velocity but none seems to work
tossv was the only one that made a change so far...
 
jonsilva said:

Due to grandfathering of older code, the X, Y, and Z velocity properties have somewhat strange names. Here's what you need.

Code:
float X = getentityproperty({ent}, "xdir");
float Y = getentityproperty({ent}, "tossv");
float Z = getentityproperty({ent}, "zdir");

Setting velocity directly as opposed to tossentity() is probably closer to what you want. Here's how. Pay attention to the axis order, it's not a typo.

Code:
changentityproperty({ent}, "velocity", X, Z, Y);


DC
 
its the same result in my post above
only the "tossv" seems to move the entity in x / y or z
depending on changing this order ("velocity", X, Z, Y)

changentityproperty "velocity"
might not work but i dont know... the player is in the air and it performs a freespecial by pressing --s key--... maybe he needs to be on floor...
but the "tossv" gets the speed perfectly if the entity has a jumpheight of 5 or a jumpframe of 5 it moves at that speed and it moves slower has the jumps starts lossing altitude... when the jump starts going down the speed is reversed (-5) 
 
I had this same problem fixed it by adding +3 to the x velocity at the start of the animation you cancel into.  I will fish out the code tomorrow.

Nice air attacks in your video.
 
Changeentityproperty({ent}, "velocity", X, Z, Y) absolutely 100% works. If it doesn't, then you are doing something wrong. Probably not getting the right velocity to put into it, or getting velocity at wrong time.

That said, if tossentity() gives the effect you want, then no reason to rock the boat.

DC
 
thanks the tossx worked for me

here is the animation script:

void tossx(int rec)
{//keep momentum when canceling jumps with "J" and "S"
void self = getlocalvar("self");
int x = getlocalvar("tossx" + self);//make a local flag to set x speed
int dir = getentityproperty(self,"direction");//get direction
int id = getentityproperty(self, "animationid");//find what animation is being canceled

if ( rec != NULL() ){
if ( id == openborconstant("ANI_JUMP")){
setlocalvar("tossx" + self, 0);}
else if ( id == openborconstant("ANI_FORWARDJUMP")){
setlocalvar("tossx" + self, 1);}
else if ( id == openborconstant("ANI_RUNJUMP")){
setlocalvar("tossx" + self, 3);}
}
else{
    if(dir==0){ // Facing left?
      x = -x ;}
  {
tossentity(self, 0, x, 0);//set recorded x speed
  }
}
}

now before the 1st frame of your characters animations "Jump", "Forwardjump" and "Runjump" add this line:

@cmd tossx 0

now before the 1st frame of the animation you want to cancel in to using "J" or "S" add this line:

@cmd tossx

hope this helps someone !

iam just having a little problem...
i needed to give the player a small impulse up of 2or3 once he pile drivers the enemy or makes a backpile

ive tried changing this lines to add a costum altitude velocity but
it dindt worked... do you know why is not working ?
void tossx(int rec, float Vely)
.
.
.
.
tossentity(self, Vely, x, 0);//set recorded x speed
 
If you want to land and then hop/toss/jump again, you need to make another animation for the bounce. If you don't, dropframe/landframe won't work on the bounce and your animation will look like crap.

So instead of land->toss, do land->new animation.

This will also simplify your work believe it or not, because you can then just use jumpframe in the second animation instead of another script.

DC
 
theres no need fo hop/toss/jump again  ;D

but its best to keep the altitude velocity a costum number depending on the slam it performs

using this script you can change altitude and keep the original velocity x from runjump/jump
void airgo(float Vely)
{// Leap with previously attained speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

  float Vx = getentityvar(self, 5); //velocity x

      if(dir==0){ // Facing left?
        Vx = -Vx ;
      }
    tossentity(self, Vely, Vx); //Move!
}

anim runjump
anim runjump
@script
void self = getlocalvar("self");
setentityvar(self, 5, 3.5);
@end_script
loop 0
delay 6
offset 100 189
bbox 79 95 50 50
cancel 5 20 0 s freespecial20
cancel 5 20 0 d s freespecial21
cancel 5 20 0 u s freespecial25
frame data/chars/3mrkarate/fall15.gif
frame data/chars/3mrkarate/fall13.gif
frame data/chars/3mrkarate/fall12.gif
frame data/chars/3mrkarate/fall11.gif
frame data/chars/3mrkarate/fall10.gif
delay 2
frame data/chars/3mrkarate/jump02.gif #5
frame data/chars/3mrkarate/jump02.gif
frame data/chars/3mrkarate/jump02.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif
frame data/chars/3mrkarate/jump05.gif #20

air slam pile driver
anim freespecial21
loop 0
delay 2
offset 100 189
bbox 0 0 0 0
@cmd airgo
followanim 4
followcond 1
landframe 5
hitfx data/sounds/grab.wav
attack 0 0 0 0
frame data/chars/3mrkarate/6grab01.gif
delay 35
attack10 90 85 65 40 0 1 1 1 25 20
dropv 3 0
frame data/chars/3mrkarate/6grab01.gif
attack10 0 0 0 0
delay 7
frame data/chars/3mrkarate/jump05.gif
@cmd anichange "ANI_JUMP"
frame data/chars/3mrkarate/jump05.gif
delay 500
frame data/chars/3mrkarate/jump05.gif
delay 12
frame data/chars/3mrkarate/rise4.gif




anim follow4
loop 0
delay 20
offset 100 185
bbox 0 0 0 0
@cmd airgo 4 <-- jumps 4 in altitude
landframe 4 dust
@cmd slamstart2
@cmd position 12 30 80 -1 1
frame data/chars/3mrkarate/4grab07.gif
delay 15
offset 110 170
@cmd position 3 30 60 -1 1
frame data/chars/3mrkarate/4grab08.gif
offset 115 171
@cmd position 15 10 50 -1 -1
frame data/chars/3mrkarate/4grab10.gif
delay 300
@cmd position 14 10 50 -1 -1
frame data/chars/3mrkarate/4grab11.gif
delay 12
@cmd spawn01 "qfx" 40 1 1
@cmd position 15 10 50 -1 -1
frame data/chars/3mrkarate/4grab12.gif #4
@cmd position 14 10 50 -1 -1
frame data/chars/3mrkarate/4grab13.gif
@cmd depost 0
@cmd finish 55 1 -1 5 0 0
delay 8
offset 115 160
frame data/chars/3mrkarate/4grab12.gif
frame data/chars/3mrkarate/4grab13.gif
offset 100 189
frame data/chars/3mrkarate/rise1.gif
frame data/chars/3mrkarate/rise2.gif
frame data/chars/3mrkarate/rise3.gif
frame data/chars/3mrkarate/rise4.gif
http://youtu.be/dH4sbH7zgxI?list=UUrm294XWVzDEqKHpYF45Kmw

using tossx script theres no small leap up during the slam... as i posted above

in here the slams go right on to the floor once they start
http://youtu.be/GXZAx6RLxS0?list=UUrm294XWVzDEqKHpYF45Kmw

 
Sorry to bring up such a old post but I was looking over the source code and I think I found where the x velocity is stopped.

Code:
// make a function so enemies can use
// UT: jumphack is a temporary fix for jump cancel
int check_costmove(int s, int fs, int jumphack)
{
    if(((fs == 1 && level->nospecial < 2) || (fs == 0 && level->nospecial == 0) || (fs == 0 && level->nospecial == 3)) &&
            (check_energy(COST_CHECK_HP, s) ||
             check_energy(COST_CHECK_MP, s))  )
    {
        if(!jumphack)
        {
            self->takeaction = common_attack_proc;
        }
        if(!nocost && !healthcheat)
        {
            if(self->modeldata.animation[s]->energycost)
            {
                if(check_energy(COST_CHECK_MP, s))
                {
                    self->mp -= self->modeldata.animation[s]->energycost->cost;
                }
                else
                {
                    self->health -= self->modeldata.animation[s]->energycost->cost;
                }
            }
        }


        self->velocity.x = self->velocity.z = 0;
        set_attacking(self);
        self->inpain = 0;
        self->inbackpain = 0;
        memset(self->combostep, 0, sizeof(*self->combostep) * 5);
        ent_unlink(self);
        ent_set_anim(self, s, 0);
        return 1;
    }
    return 0;


if this line: "self->velocity.x = self->velocity.z = 0;" was removed I think it would fix the lost momentum.  if someone wanted to stop momentum during a jump cancel it is very easy to do but to re-apply it is not impossible but a lot more complicated as you cant tell at what point player will cancel and there is no script to activate on a cancel if this is correct I would like to apply this simple fix.
 
Back
Top Bottom