Oh, I see! As-is, the example I posted should wait forever until the player presses the right button.
This can be used to check if any button is being pressed in
Conditional Branch > Script:
JavaScript:
Object.values(Input.keyMapper).some(key => Input.isPressed(key))
Might be helpful if you wanted to wait until any key is pressed, then fail if it's not the correct key, e.g.
Spoiler: Wait for any input, fail if wrong
Code:
◆Comment:Wait for no keys pressed
◆Loop
◆If:Script:Object.values(Input.keyMapper).some(key => Input.isPressed(key))
◆Comment:Some key is being pressed
◆Wait:1 frame
◆
:Else
◆Break Loop
◆
:End
◆
:Repeat Above
◆Comment:Wait for any key press
◆Loop
◆If:Script:Object.values(Input.keyMapper).some(key => Input.isPressed(key))
◆If:Button [Down] is being pressed
◆Text:None, None, Window, Bottom
: :Yay
◆Comment:Success
◆
:Else
◆Text:None, None, Window, Bottom
: :Nay
◆Comment:Fail
◆
:End
◆Break Loop
◆
:Else
◆Wait:1 frame
◆
:End
◆
:Repeat Above
To add a timeout instead (or as well?), you can use a variable to count down the frames and show the "fail" message when it hits 0, e.g.
Spoiler: Press within in X frames
Code:
◆Comment:5 seconds = 300 frames to press the button
◆Control Variables:#0023 time = 300
◆Comment:Ask for input
◆Text:None, None, Window, Bottom
: :Press [down] to walk.
◆Comment:Check for input
◆Loop
◆If:Button [Down] is being pressed
◆Comment:Success!
◆Break Loop
◆
:Else
◆Comment:1 frame closer to failure
◆Control Variables:#0023 time -= 1
◆If:time ≤ 0
◆Comment:Time's up!
◆Break Loop
◆
:Else
◆Comment:Check again next frame
◆Wait:1 frame
◆
:End
◆
:End
◆
:Repeat Above
◆Comment:Say something
◆If:time > 0
◆Text:None, None, Window, Bottom
: :Congratulations! You learned the "Walk" skill!
◆
:Else
◆Text:None, None, Window, Bottom
: :OK I guess you're staying here.
◆
:End
For timed stuff you might find this tutorial helpful~
Quick Time Events (QTEs) can add an extra bit of interaction between our players and our games, rewarding them for their focus. So let’s take a look at how we can event one type of QTEs: timed hits.
www.rpgmakerweb.com
(It's ~01:40 here so I'm going to bed now.)