Changing direction during freespecial

mersox

Active member
Hey guys, I think this might be my first time posting here. Years ago I was working on a Power Rangers mod and something tells me I came here for answers then. ANYWAY, I'm working on a TMNT mod now, based off GaBoTiCo's TMNT 8bit mod. THE QUESTION:

You know when a FREESPECIAL animation is playing, and you press the opposite direction on your pad or keyboard, and the characters turns to face the opposite direction mid-attack? It's so annoying. Is there a way to not allow that? So that openbor doesn't accept any new inputs until the animation is over?

I tried the IDLE command but it did nothing.

I accept suggestions. Thanks guys.
 
Sure. Thanks for replying. I have two freespecials and both are triggered during jump:

anim freespecial3
loop 0
delay 10
jumpframe 0 2 0 0 0
offset 29 57
bbox 24 10 13 49
frame data/chars/Leo/Attack31.gif
bbox 20 10 13 49
              attack    38 29 29 20 2 0
              delay      10
              sound    data/sounds/punch.wav
frame data/chars/Leo/Attack32.gif
bbox 24 10 13 49
              attack    0 0 0 0 0 0
frame data/chars/Leo/Attack33.gif

********

anim freespecial2 
loop 0
              jumpframe 0 -0.3 2 0 0
delay 30
offset 29 57
bbox 24 10 13 49
              attack2    44 43 8 15 1 1
              sound    data/sounds/punch.wav
frame data/chars/Leo/Jattack1.gif

******

anim jump
loop 0
offset 29 57
bbox 24 10 13 49
cancel 0 0.005 0 a freespecial3
frame data/chars/Leo/Jump01.gif
delay 20
offset 29 57
bbox 24 10 13 49
frame data/chars/Leo/Jump01.gif
              delay      15
              bbox      21 18 19 23
frame data/chars/Leo/Jump02.gif
frame data/chars/Leo/Jump03.gif
frame data/chars/Leo/Jump04.gif
frame data/chars/Leo/Jump05.gif
cancel 2 6 0 a freespecial2
frame data/chars/Leo/Jump02.gif
frame data/chars/Leo/Jump03.gif
frame data/chars/Leo/Jump04.gif
frame data/chars/Leo/Jump05.gif
frame data/chars/Leo/Jump02.gif
frame data/chars/Leo/Jump03.gif
frame data/chars/Leo/Jump04.gif
frame data/chars/Leo/Jump05.gif
 
Oh you must have allowed flipping during jumping. By default, it's not allowed even for just jumpattacks.

Check Leo's header text and find jumpmove command. If the first parameter is set to 1, then you have allowed Leo to flip while jumping. Set it to 0 to disable it or just remove this command if you don't need it.

Read manual for more info jumpmove
 
Thanks for replying, Bloodbane.

Your suggestion would solve this issue BUT would affect Leo's jump movement. I'm trying to replicate his movements from TMNT 2 for the NES, and in that game you can jump freely (more so than what Openbor allows) until you press the attack button.
 
Thanks again, man. That prevents the animation from flipping but it affects the movement liberty of the jump.

I have a feeling I will have to venture once again into the world of scripts.

Thanks guys for the replies.
 
Thank guys for the suggestions. I'll check them out.

BeasTie you are correct that project is still a WIP. For the moment it's not a team up, his and mine are different projects.
 
Hey guys. Let's try this again.

I was looking at Bloodbane's script and there's something called "keyflip". I'm traying to figure out how to change it to fit my need. Basically keyflip makes the character change directions depending on if right or left is pressed. I need something like this except different. I need  the freespecial animation to ignore the left and right presses until the animation is over.

So part of the keyflip command says:
if (playerkeys(iPIndex, 0, "moveleft")){ // Left is pressed?
      changeentityproperty(self, "direction", 0); //Face left

I guess I need something like
if (playerkeys(iPIndex, 0, "moveleft")){ // Left is pressed?
      changeentityproperty(self, "direction", 0); //DON'T YOU DARE TO DO ANYTHING, OPENBOR

How can I do that? Arghhhh. What would be the command for "don't do anything"?

I can't find the info anywhere
 
Why don't you think the opposite? IOW don't set jumpmove at all and set keyflip ONLY in JUMP animations. This way, is Leo performs FREESPECIAL or JUMPATTACK, he can't flip since there's nothing which allows him.

I still think that keyscript would do the job better but if keyflip function works for you then why not? :)
 
Well, Openbor crashes when I add

animationscript data/scripts/script.c

to leo's txt. I'm pretty sure it's because I'm using a Mac. :/

Thanks for replying. Also, your Lock and Loaded module is very impressive.
 
Thanks!

Oh about that crash, if you set animationscript without declaring any @cmd, you'll get crash. So to solve this, either disable it temporarily or declare at least one @cmd somewhere
 
I have a jump slam that allows movement during the slam (in air and ground) ive copyed it from crimebusters maxima and adapted to this character

anim grabattack2
loop 0
delay 7
offset 145 205
bbox 108 121 33 80
hitfx data/sounds/beat5.wav
@cmd keyint "ANI_GRABDOWN2" 0 "J" 0 0
frame data/chars/0yuri/d08.gif
blast 140 85 35 75 10 1 0 0 20 0
dropv 4 2.5
frame data/chars/0yuri/d25.gif
blast 0 0 0 0
delay 9
delay 12
frame data/chars/0yuri/d30.gif

(press jump makes the slam)
(attacking forward 3 times makes the grabattack 2)


SLAM (grabdown2)
anim grabdown2
delay 3
attackone 0
offset 145 205
jumpframe 4 4
landframe 9 qfx
quakeframe 9 1 7
frame data/chars/0yuri/grabat03.gif
@cmd grabcheck
@cmd anti
frame data/chars/0yuri/grabat03.gif
delay 6
@cmd slamstart
@cmd position 10 40 50 -1 -1
frame data/chars/0yuri/grabat18.gif
@cmd keywlk 1.5
@cmd position 10 40 50 -1 -1
frame data/chars/0yuri/grabat18.gif
@cmd keywlk 1.5
@cmd position 11 35 60 -1 -1
frame data/chars/0yuri/grabat19.gif
@cmd depost 0
@cmd finish 25 1 -1 3 0 0
delay 10
frame data/chars/0yuri/grabat23.gif
frame data/chars/0yuri/rise2.gif
@cmd leaper 0 2.5 0
frame data/chars/0yuri/rise5.gif
@cmd keywlk 1.8
frame data/chars/0yuri/rise6.gif

unfortunately  you have to declare @cmd keywlk in all frames
for the entire animation to move

this is the script iam using (keywlk moves left and right)
void keywlk(float V)
{// Move hero if direction button is pressed
      void self = getlocalvar("self");
      int iPIndex = getentityproperty(self,"playerindex"); //Get player index
float xdir = 0;

      if (playerkeys(iPIndex, 0, "moveleft")){// Left is pressed?
  xdir = -V;
} else if(playerkeys(iPIndex, 0, "moveright")){// Right is pressed?
  xdir = V;
      }


changeentityproperty(self, "velocity", xdir);
}

this is the original script (keymove moves up,down,left.right)

void keymove(float V)
{// Move hero if direction button is pressed
      void self = getlocalvar("self");
      int iPIndex = getentityproperty(self,"playerindex"); //Get player index
float xdir = 0;
float zdir = 0;

      if (playerkeys(iPIndex, 0, "moveleft")){// Left is pressed?
  xdir = -V;
} else if(playerkeys(iPIndex, 0, "moveright")){// Right is pressed?
  xdir = V;
      }

if(playerkeys(iPIndex, 0, "moveup")){// Up is pressed?
  zdir = -V/2;
} else if(playerkeys(iPIndex, 0, "movedown")){// Down is pressed?
  zdir = V/2;
      }

changeentityproperty(self, "velocity", xdir, zdir);
}

.......keyint is a big ass script...here goes the full page in the forum
void keyint(void Ani, int Frame, void Key, int Hflag, int Limit)
{// Change current animation if proper key is pressed or released provided HP is more than limit
    void self = getlocalvar("self");
    void Health = getentityproperty(self,"health");   
    int iPIndex = getentityproperty(self,"playerindex"); //Get player index
    void iRKey;

      if (Key=="U"){ //Up Required?
      iRKey = playerkeys(iPIndex, 0, "moveup"); // "Up"
}

      if (Key=="D"){ //Down Required?
        iRKey = playerkeys(iPIndex, 0, "movedown"); // "Down"
}

      if (Key=="F"){ //Down Required?
        iRKey = playerkeys(iPIndex, 0, "movefoward"); // "foward"
}



      if (Key=="J"){ //Jump Required?
        iRKey = playerkeys(iPIndex, 0, "jump"); // "Jump"
}

      if (Key=="A"){ //Attack Required?
        iRKey = playerkeys(iPIndex, 0, "attack"); // "Attack"
}

      if (Key=="S"){ //Special Required?
        iRKey = playerkeys(iPIndex, 0, "special"); // "Special"
}

      if (Key=="A2"){ //Attack2 Required?
        iRKey = playerkeys(iPIndex, 0, "attack2"); // "Attack2"
}


      if (Key=="FJ"){ //Up and Jump Required?
        iRKey = playerkeys(iPIndex, 0, "movefoward", "jump"); // "Up" + "foward"
}



      if (Key=="UJ"){ //Up and Jump Required?
        iRKey = playerkeys(iPIndex, 0, "moveup", "jump"); // "Up" + "Jump"
}

      if (Hflag==1){ //Not holding the button case?
        iRKey = !iRKey; //Take the opposite condition
}

      if ((Health > Limit)&&iRKey){
        changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
        changeentityproperty(self, "animpos", Frame);

        if (Key=="UJ"){
          // This is copy of dethrown
          changeentityproperty(self, "attacking", 0);
          changeentityproperty(self, "damage_on_landing", 0);
          changeentityproperty(self, "projectile", 0);
        }
      }
}

 
Back
Top Bottom