Combination of buttons/keys like in fighting games?

Hello there! over the last months ive been working on my action rpg system for mv, the whole thing is done already.
Except for one detail, combos!

Of course, even trough eventing i can tell the engine to turn different switches on when pressing different buttons, but i need to know a couple things more like:

-letting the engine know the order the keys were pressed
-setting up a timer so the combination resets if no more keys are pressed after 30 frames (for example)

Has anyone any experience with this? or if someone has any idea on how to approach this problem, any help is appreciated!
Thanks a lot in advance 🙂
Variables! 😂 Here's a couple of ideas:
  • Have a number of variables to track button inputs and another to track which input you're currently on:
    Code:
    ◆Comment:Assumes you have the "ID" of the pressed button
    :       :stored in a variable called "button ID"
    ◆Control Variables:#0041 comboStage += 1
    ◆Control Variables:#0046 comboTimer = 30
    ◆If:comboStage = 1
      ◆Control Variables:#0042 input 1 += button ID
      ◆
    :Else
      ◆If:comboStage = 2
        ◆Control Variables:#0043 input 2 += button ID
        ◆
      :Else
        ◆Control Variables:#0044 input 3 += button ID
        ◆
      :End
      ◆
    :End
    If you know what you're doing and think it's worth it, it's possible to merge the inputs into one variable, e.g. if you know there's only 9 different valid button inputs (10 counting "no input"), use base ten and add inputs to the appropriate "column" of the number via multiplication (1, 10, 100, etc).

  • For the timer, you could have a variable that counts down via a parallel event:
    Code:
    ◆Control Variables:#0046 comboTimer -= 1
    ◆If:combo timer ≤ 0
      ◆Control Variables:#0041 comboStage = 0
      ◆Control Variables:#0042 input 1 = 0
      ◆Control Variables:#0043 input 2 = 0
      ◆Control Variables:#0044 input 3 = 0
      ◆
    :End
*facepalm* of course! thank you so much 😀 this should be enough to make what i want, i said fighting games on the title but i was thinking of something like dynasty warriors so very basic inputs

Original thread: https://forums.rpgmakerweb.com/threads/combination-of-buttons-keys-like-in-fighting-games.112130/