fighting game extended keyboard movement keys macros

Post gaming related scripts
SynSight
Posts: 1
Joined: 01 May 2018, 03:19

fighting game extended keyboard movement keys macros

06 May 2018, 21:57

Extended movement key macros for people that like to use the number pad when playing fighting games with keyboards.
For people struggling to input special commands in the middle of combos using a keyboard, this makes it slightly less difficult for beginner level players.

This version of the script is optimized to support the default key configurations and special input commands for the "Them's Fightin' Herds" game.

Some scripts for other fighting games were in the old archived forum:
https://autohotkey.com/board/topic/6437 ... ame-macro/

No longer using any code for script management through a GUI, though.

Code: Select all

;Them's Fightin' Herds special macro 
;Extended keyboard movement keys macro
;Written by SynSight
;;; HotKey Layout
;;;
;;;  Backspace/                                               
;;;  PgUp        NumLk     (numpad)/        (numpad)*        (numpad)-
;;; [tbd]         [27]          [28]           [29]          [tbd]
;;;
;;;          (numpad)7       (numpad)8        (numpad)9
;;;               [214]          [8]           [236]
;;;  Delete/
;;;  PgDn/
;;;  Enter*   (numpad)4       (numpad)5        (numpad)6      (numpad)+
;;; [63214]        [4]           [2]            [6]           [41236]
;;;
;;;           (numpad)1      (numpad)2        (numpad)3
;;;               [421]         [2->8]          [623]
;;;
;;;                          (numpad)0
;;;                             [22]
;;;         
;;;
;;; Example: NumLk results in ["down then up+left"]
;;;          Numpad7 results in ["down then down+left then left"]
;;; Note: Final direction of all hotkeys are held until key is released.
;;; Post-Note: Except (numpad)2.  On release, it does a quick jump.
;;;
;;; *Enter: Since Enter is used in the games default 'Start' key configuration, 
;;;         the Enter key macros is commented out by default. 
;;;
;;; Them's Fightin' Herds note:
;;; Arizona's Magic Dash uses Delete/PgDn/Enter and Numpad+ buttons.
;;; Arizona/Paprica/Tianhuo use NumLk, Numpad/, numpad*, and numpad2 for super jump. 
;;; Velvet uses numpad1, and numpad3 for Ice Eruption.
;;; Oleander, Arizona, and Pom use numpad0 for various. 
;;; All charaters use supers with numpad7 and numpad8. 
;;;
;;;Player1 Attack Keys (based off the player 1 default controls).
;;;
;;;Key Names based off ingame control names. 
;;;AL: A (Light);
;;;BM: B (Medium);
;;;CH: C (Heavy);
;;;DM: D (Magic);  
;;; 
;;;                '1'        '2'
;;;             Enter/Start*  Select**
;;;
;;;                'q'        'w'      
;;;                TBD        TBD      
;;;
;;;  'capslck'     'a'        's'      'd'       'f'      'g'     'Enter'
;;;  BM+CH(Throw)  AL         BM       CH        Select   Macro1  Start
;;;
;;;  'l-shift'     'z'        'x'      'c'       'v'
;;;    AL+CH        DM        Util1    Util2     Macro2
;;;
;;;  'ctrl+'
;;;  rapid attack*
;;;
;;;  *Any attack macro above becomes rapid fire if pressed down while 'ctrl' is pressed down.
;;;  Note: No character specials require rapid attacks to activate yet. 
;;;
;;;  Depending on keyboards, LShift can missfire if held down while
;;;  inputting directional commands.
;;;
;;;  *Because 'Enter' is next to numpad4 on some keyboards, some keyboards will want to have
;;;  Arizona's half-circle mapped to 'Enter'.  Because 'Return Key' is default for Start, 
;;;  either use the numpad-enter key, or use the remapped '1' key (number row) to press Start.  
;;;
;;;  **Select mirrored to '2' just to keep it next to Start. 
;;;

#MaxHotkeysPerInterval 500

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Define which key performs which action here:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Set the Movement Button Keys Here
P1_Up = {up DownTemp}
P1_Up_End = {up up}
P1_Down = {down DownTemp}
P1_Down_End = {down up}
P1_Left = {left DownTemp}
P1_Left_End = {left up}
P1_Right = {right DownTemp}
P1_Right_End = {right up}

;; Set Attack Button Keys Here
P1_AL = a
P1_AL_State = U
P1_AL_Start = {%P1_AL% DownTemp}
P1_AL_End = {%P1_AL% up}
P1_BM = s
P1_BM_State = U
P1_BM_Start = {%P1_BM% DownTemp}
P1_BM_End = {%P1_BM% up}
P1_CH = d
P1_CH_State = U
P1_CH_Start = {%P1_CH% DownTemp}
P1_CH_End = {%P1_CH% up}
P1_DM = z
P1_DM_State = U
P1_DM_Start = {%P1_DM% DownTemp}
P1_DM_End = {%P1_DM% up}

;; Set Misc. Game Button Keys Here
P1_Start = Enter
P1_Start_Start = {%P1_Start% DownTemp}
P1_Start_End = {%P1_Start% up}
P1_Select = f
P1_Select_Start = {%P1_Select% DownTemp}
P1_Select_End = {%P1_Select% up} 


;; Special variable for preparing a 28 attacks.
;; Pressing Numpad2 sets the value it to 'Down' state.
;; Releasing Numpad2 resets it to 'Up' state, and does a quick jump.
;; Releasing Numpad5 also resets it to 'Up' state, and does a quick jump.
P1_Set_Quickjump = U

SetNumlockState On


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Disable Windows key
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
*LWin::
return
*LWin up::
return


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;One Button Attack Key Remapping
;;There is a point to this.
;;Used to track which single buttons the player
;;is holding down so that two-button macros
;;will avoid using those keys when possible.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
*a::
SetKeyDelay -1
P1_AL_State = D
Send {Blind}%P1_AL_Start%
return
*a up::
SetKeyDelay -1
P1_AL_State = U
Send {Blind}%P1_AL_End%
return

*s::
SetKeyDelay -1
P1_BM_State = D
Send {Blind}%P1_BM_Start%
return
*s up::
SetKeyDelay -1
P1_BM_State = U
Send {Blind}%P1_BM_End%
return

*d::
SetKeyDelay -1
P1_CH_State = D
Send {Blind}%P1_CH_Start%
return
*d up::
SetKeyDelay -1
P1_CH_State = U
Send {Blind}%P1_CH_End%
return

*z::
SetKeyDelay -1
P1_DM_State = D
Send {Blind}%P1_DM_Start%
return
*z up::
SetKeyDelay -1
P1_DM_State = U
Send {Blind}%P1_DM_End%
return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Misc. Button remapped to number row.
;; The default buttons for start and select 
;; are moved because this script overloads 
;; those keys.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

*1::
SetKeyDelay -1
Send {Blind}%P1_Start_Start%
return

*1 up::
SetKeyDelay -1
Send {Blind}%P1_Start_End%
return

*2::
SetKeyDelay -1
Send {Blind}%P1_Select_Start%
return

*2 up::
SetKeyDelay -1
Send {Blind}%P1_Select_End%
return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; rapid fire
; For characters with rapid-attack specials...
; Hold Ctrl + attack.  Only the attack button 
; must be held down to continue the rapid fire.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

^a::
SetKeyDelay -1
Loop
{
  Send {Blind}%P1_AL_Start%
  Sleep, 25
  Send {Blind}%P1_AL_End%
  Sleep, 25
  if not GetKeyState("a", "P")
    break
}
return
^a up::
return

^s::
SetKeyDelay -1
Loop
{
  Send {Blind}%P1_BM_Start%
  Sleep, 25
  Send {Blind}%P1_BM_End%
  Sleep, 25
  if not GetKeyState("s", "P")
    break
}
return
^s up::
return

^d::
SetKeyDelay -1
Loop
{
  Send {Blind}%P1_CH_Start%
  Sleep, 25
  Send {Blind}%P1_CH_End%
  Sleep, 25
  if not GetKeyState("d", "P")
    break
}
return
^d up::
return

^z::
SetKeyDelay -1
Loop
{
  Send {Blind}%P1_DM_Start%
  Sleep, 25
  Send {Blind}%P1_DM_End%
  Sleep, 25
  if not GetKeyState("z", "P")
    break
}
return
^z up::
return





;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; two-button macros
; not really needed with in-game macros
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;; Will attempt to do BM + CH even if the keys are already being held down.
*CapsLock::
SetKeyDelay -1
Send {Blind}%P1_BM_Start%%P1_CH_Start%
return
*CapsLock up::
SetKeyDelay -1
if P1_AL_State != D
  Send {Blind}%P1_BM_End%
if P1_DM_State != D
  Send {Blind}%P1_CH_End%
return


;; Will attempt to do CH + BM even if the keys are already being held down.
*LShift::
SetKeyDelay -1
Send {Blind}%P1_CH_Start%%P1_AL_Start%
return
*LShift up::
SetKeyDelay -1
if P1_CH_State != D
  Send {Blind}%P1_CH_End%
if P1_BM_State != D
  Send {Blind}%P1_AL_End%
Send {Blind}{LShift up}
return



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; two-button macros w/ Rapid Fire
; Ctrl + attack button (hold attack button)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Will attempt to do AL + CH even if the keys are already being held down.
^CapsLock::
SetKeyDelay -1
Loop
{
  Send {Blind}%P1_BM_Start%%P1_CH_Start%
  Sleep, 25
  Send {Blind}%P1_BM_End%%P1_CH_End%
  Sleep, 25
  if not GetKeyState("CapsLock", "P")
    break
}
^CapsLock up::
return

;; Will attempt to do AL + CH even if the keys are already being held down.
^LShift::
SetKeyDelay -1
Loop
{
  Send {Blind}%P1_CH_Start%%P1_AL_Start%
  Sleep, 25
  Send {Blind}%P1_CH_End%%P1_AL_End%
  Sleep, 25
  if not GetKeyState("LShift", "P")
    break
}
return
^LShift up::
return




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;One Button Direction Key Remapping
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

*Numpad8::
*NumpadUp::
SetKeyDelay -1
Send {Blind}%P1_Up%
return
*Numpad8 up::
*NumpadUp up::
SetKeyDelay -1
Send {Blind}%P1_Up_End%
return

*Numpad4::
*NumpadLeft::
SetKeyDelay -1
Send {Blind}%P1_Left%
return
*Numpad4 up::
*NumpadLeft up::
SetKeyDelay -1
Send {Blind}%P1_Left_End%
return

*Numpad6::
*NumpadRight::
SetKeyDelay -1
Send {Blind}%P1_Right%
return
*Numpad6 up::
*NumpadRight up::
SetKeyDelay -1
Send {Blind}%P1_Right_End%
return

*Numpad5::
*NumpadClear::
SetKeyDelay -1
Send {Blind}%P1_Down%
return
*Numpad5 up::
*NumpadClear up::
SetKeyDelay -1
Send {Blind}%P1_Down_End%
if P1_Set_Quickjump = D
{
  P1_Set_Quickjump = U
  Send {Blind}%P1_Up%
  Sleep, 25
  Send {Blind}%P1_Up_End%
}
return


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; high jump left, up, right set to NumLk, /, *
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
*NumpadDiv::
 SetKeyDelay -1
 Send {Blind}%P1_Down%
 Sleep, 25
 Send {Blind}%P1_Down_End%%P1_Up%
 Sleep, 25
 KeyWait, NumpadDiv
 Send {Blind}%P1_Up_End%
return

*NumpadDiv up::
return

*NumpadMult::
 SetKeyDelay -1
 Send {Blind}%P1_Down%
 Sleep, 25
 Send {Blind}%P1_Down_End%%P1_Up%%P1_Right%
 Sleep, 25
 KeyWait, NumpadMult
 Send {Blind}%P1_Up_End%%P1_Right_End%
return

*NumpadMult up::
return

*NumLock::
 SetNumlockState On
 SetKeyDelay -1
 Send {Blind}%P1_Down%
 Sleep, 25
 Send {Blind}%P1_Down_End%%P1_Up%%P1_Left%
 Sleep, 25
 KeyWait, NumLock
 Send {Blind}%P1_Up_End%%P1_Left_End%
return

*NumLock up::
return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Half Circle
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;  41236 : Half Circle to the Right 
*NumpadAdd::
 SetKeyDelay -1
 Send {Blind}%P1_Left%
 Sleep, 25
 Send {Blind}%P1_Down%
 Sleep, 25
 Send {Blind}%P1_Left_End%
 Sleep, 25
 Send {Blind}%P1_Right%
 Sleep, 25
 Send {Blind}%P1_Down_End%
 Sleep, 25
 KeyWait, NumpadAdd  ;Key used for the KeyWait must match the macro key
 Send {Blind}%P1_Right_End%
return

*NumpadAdd up::
return

;; 63214 : Half Circle to the Left
;; *Enter::
*PgDn::
*Delete::
 SetKeyDelay -1
 Send {Blind}%P1_Right%
 Sleep, 25
 Send {Blind}%P1_Down%
 Sleep, 25
 Send {Blind}%P1_Right_End%
 Sleep, 25
 Send {Blind}%P1_Left%
 Sleep, 25
 Send {Blind}%P1_Down_End%
 Sleep, 25
 KeyWait, Delete ;... some keyboards
 KeyWait, Enter ;Key used for the KeyWait must match the macro key
 KeyWait, PgDn ;Key used for the KeyWait must match the other macro key
 Send {Blind}%P1_Left_End%
return

*PgDn up::
;; *Enter up::
*Delete up::
return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Three Direction Input Special Attacks  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;auto for 236 quarter circle forward
*Numpad9::
*NumpadPgUp::
 SetKeyDelay -1
 Send {Blind}%P1_Down%
 Sleep, 25
 Send {Blind}%P1_Right%
 Sleep, 25
 Send {Blind}%P1_Down_End%
 Sleep, 25
 SetNumlockstate On
 KeyWait, Numpad9 ;Key used for the KeyWait must match the macro key
 Send {Blind}%P1_Right_End%
return

*Numpad9 up::
*NumpadPgUp up::
return


;auto for 214 quarter circle backward
*Numpad7::
*NumpadHome::
 SetKeyDelay -1
 Send {Blind}%P1_Down%
 Sleep, 25
 Send {Blind}%P1_Left%
 Sleep, 25
 Send {Blind}%P1_Down_End%
 Sleep, 25
 SetNumlockstate On
 KeyWait, Numpad7 ;Key used for the KeyWait must match the macro key
 Send {Blind}%P1_Left_End%
return

*Numpad7 up::
*NumpadHome up::
return

;auto for 623 special
*Numpad3::
*NumpadPgDn::
 SetKeyDelay -1
 Send {Blind}%P1_Right%
 Sleep, 25
 Send {Blind}%P1_Right_End%
 Sleep, 10
 Send {Blind}%P1_Down%
 Sleep, 25
 Send {Blind}%P1_Right%
 Sleep, 25
 SetNumlockstate On
 KeyWait, Numpad3  ;Key used for the KeyWait must match the macro key
 Send {Blind}%P1_Right_End%%P1_Down_End%
return

*Numpad3 up::
*NumpadPgDn up::
return

;421 forward
*Numpad1::
*NumpadEnd::
 SetKeyDelay -1
 Send {Blind}%P1_Left%
 Sleep, 25
 Send {Blind}%P1_Left_End%
 Sleep, 10
 Send {Blind}%P1_Down%
 Sleep, 25
 Send {Blind}%P1_Left%
 Sleep, 25
 SetNumlockstate On
 KeyWait, Numpad1  ;Key used for the KeyWait must match the macro key
 Send {Blind}%P1_Left_End%%P1_Down_End%
return

*Numpad1 up::
*NumpadEnd up::
return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Two Direction Input Special Attacks 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;hold Down.  Up on release.  Used to aid with the down&up attacks.
;integrated with numpad2
*Numpad2::
*NumpadDown::
SetKeyDelay -1
SetNumlockstate On
P1_Set_Quickjump = D
Send {Blind}%P1_Down%
Sleep, 25
Keywait, Numpad2  ;Used to stop script from repeating while held down.
return

*Numpad2 up::
*NumpadDown up::
SetKeyDelay -1
if P1_Set_Quickjump = D
{
  P1_Set_Quickjump = U
  Send {Blind}%P1_Down_End%
  Send {Blind}%P1_Up%
  Sleep, 25
  Send {Blind}%P1_Up_End%
}
return


; Double Down.
*Numpad0::
 SetKeyDelay -1
 Send {Blind}%P1_Down%
 Sleep, 25
 Send {Blind}%P1_Down_End%
 Sleep, 25
 Send {Blind}%P1_Down%
 Sleep, 25
 SetNumlockstate On
 KeyWait, Numpad0  ;Key used for the KeyWait must match the macro key
 Send {Blind}%P1_Down_End%
return

*Numpad0 up::
return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Complicated/Unusual
;; Direction Input Special Attacks.  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; e.g. Vice specials, Dizzy specials, etc. 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; End of code specific to fighting games
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 25 guests