[SOLVED] Major attack bug

NickyP

Active member
I discovered this yesterday when I was toying with a shoot em up demo...

If you hold up+left, none of the Attack buttons work. Note that Jump and Special works, but not Attack1-4. Also, Attack works if you're walking in other diagonal directions (up+right, down+right, down+left).

Please fix this? It completely ruins shoot em up gameplay, considering you hold the attack button and move to shoot... if the player can't go up+left, not only does it look and feel ghetto, it also severely limits enjoyment of gameplay.
 
You can use this keyscript by MatMan for moving while attacking.  I use for doom mod to avoid this problem.

just declare it as keyscript in player.txt

I can't remember if aniscp.c is required, if it is you can get it from MixMasters mod.

Code:
// Script for moving while attacking.
#include "data/scripts/aniScp.c"

void main(){
  // get variables ready
  int player = getlocalvar("player");
  
  void self = getplayerproperty(player, "ent");
  int anim = getentityproperty(self, "animationid");
  //I'm sure there is a better way of doing this but....
  if ( anim == openborconstant("ANI_Attack1" )
      || anim == openborconstant("ANI_Attack2")
      || anim == openborconstant("ANI_Attack3") ) {

    if ( checkkeycombo(self, "UF", 0) ) {
      tossself(0, -0.3, 0, -0.3);
    } else
    if ( checkkeycombo(self, "UB", 0) ) {
      tossself(0, 0.3, 0, -0.3);
    } else
    if ( checkkeycombo(self, "DF", 0) ) {
      tossself(0, -0.3, 0, 0.3);
    } else
    if ( checkkeycombo(self, "DB", 0) ) {
      tossself(0, 0.3, 0, 0.3);
    } else
    if ( checkkeycombo(self, "F", 0) ) {
      tossself(0, -0.3, 0, 0);
    } else
    if ( checkkeycombo(self, "B", 0) ) {
      tossself(0, 0.3, 0, 0);
    } else
    if ( checkkeycombo(self, "U", 0) ) {
      tossself(0, 0, 0, -0.3);
    } else
    if ( checkkeycombo(self, "D", 0) ) {
      tossself(0, 0, 0, 0.3);
    }
  }

}

might need to edit it to suit the movement speed you want.
 
Moving while attacking isn't really an issue, because I've tested this in other mods. Even in the original BOR. You cannot attack if you move diagonally up and left.

EDIT: ... That's not to say that script isn't appreciated! I'm using a different setup. In idle and walking animations there's a cmd that basically changes you to a different animation when a certain key is pressed; and the resulting animation has a delay of 1. So holding down the attack button continuously goes in and out of the attack animation.
 
Sorry it was just made for doom so your feet don't get glued to the floor everytime you fire a shot.  You could try changing the animations in the script to point to the ones you're using.
 
This issue still exists in the latest version of OpenBOR. You cannot attack while moving diagonally up and left.

EDIT: In an extremely confusing turn of events, I discovered that I can indeed attack while moving diagonally up and left... as long as Attack1 isn't mapped to the S key on my keyboard. If I map Attack1 to any other button, like W or R, it works perfect. Note however that while Attack1 is mapped to S, I can attack in every other direction besides up+left.

I cannot for the life of me figure out if this is a very peculiar engine bug, or if my laptop keyboard is messing with me.
 
Its keyboard problem, because arrows and S share ground on circuit board because it saved time and components, so if keys A and D share path on circuit board then you cant press them at the same time, whichever is pressed first.
If you hold 3 or more keys at the same time then some keys wont work unless you have gaming keyboard where every key is soldered separately.
 
+1 on bwwd' post. This is not a bug at all, but a hardware limitation of most keyboards. Emulator players often run into this issue - a common example is the door code in Chrono Trigger.

Without resorting to command macros the only way around it is use a joystick or pony up the bucks for premium keyboard.

DC
 
Well I'll be darn. Learned something new today. Thank you very much, bwwd and DC! Case closed.
 
you will still have an issue making a shooter that every time you attack it plays the attack animation, which stops your movement, so the some kind of script is needed.  Checkout  bloodbane's auto fire method in Contra mod.
 
Already worked that out, as you can see from this little snippet I made in an hour: http://imgur.com/lRrpipH
 
Back
Top Bottom