yomaniac

Villager
Member
Joined
Sep 21, 2017
Messages
21
Reaction score
1
First Language
English
Primarily Uses
N/A
I am trying to make a mechanic where the player needs to rapidly press a key on the keyboard to continue the game, if they fail then it's game over. Anyone know how to do this?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,357
Reaction score
8,771
First Language
German
Primarily Uses
RMMV
Basically a series of conditional branches with waits, switches and variables for controlling.
The conditional branch checks if a key is pressed, but then you'll have to check if it is released again before counting - that is where you need to use switches and different nested conditional branches.
 

AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
Basically a series of conditional branches with waits, switches and variables for controlling.
The conditional branch checks if a key is pressed, but then you'll have to check if it is released again before counting - that is where you need to use switches and different nested conditional branches.

Is there a way to check specifically if a key has been released? Or would you just use a conditional branch to check if it's been pressed and then do stuff in the "Else" part of it?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,357
Reaction score
8,771
First Language
German
Primarily Uses
RMMV
No, that is why you need switches and a series of conditional branches.
A key has been released if it it not pressed now but was pressed previously (as stored in the switch)
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,986
Reaction score
2,304
First Language
EN
Primarily Uses
RMMZ
To elaborate...something like this:
Code:
◆Control Switches:#0001 ButtonDown = OFF
◆Control Variables:#0004 Input = 0
◆Loop
  ◆If:ButtonDown is ON
    ◆If:Button [OK] is pressed down
      ◆Comment:Nothing.
      ◆
    :Else
      ◆Comment:Button was pressed and released!
      ◆Control Switches:#0001 ButtonDown = OFF
      ◆Control Variables:#0004 Input += 1
      ◆
    :End
    ◆
  :Else
    ◆If:Button [OK] is pressed down
      ◆Comment:Button is now pressed down!
      ◆Control Switches:#0001 ButtonDown = ON
      ◆
    :End
    ◆
  :End
  ◆If:Input = 10
    ◆Break Loop
    ◆
  :Else
    ◆Wait:1 frame
    ◆
  :End
  ◆
:Repeat Above
◆Text:None, Window, Bottom
:    :You escaped! \.Congratulations!
Adding a timer to it just requires another variable (and branches) to count & check how many times the loop has run. ^_^

I happen to have a worked example, timed and with picture prompts, over on the Steam Workshop if you're interested. It's for battle skill input, but a couple of them use a "button mash" approach (the actual events don't require any plugins, don't worry). It may be a bit over-complicated for this purpose but here's a link if you're interested: https://steamcommunity.com/sharedfiles/filedetails/?id=1287577261
 

Latest Threads

Latest Profile Posts

Well, I've got a party tomorrow, and my friends are coming over. I wanted to work a bit on the Fandom Scouts assets so I can be ready when that update arrives... in other news, Pizza Time Horror is getting a second teaser, and it shows Cabaret Helen's last performance before the location closed.
Also who used to be scared of Chuck E as a kid? I was! Now I love him!
The new cards and what they do:

(I am clearly not a youtuber... Haha)
Just for the record you CAN use the "Exclude unused files" successfully to trim a project down seriously even if you're doing calls to various assets via plugins and such. BUT you need to do a full playtest of pretty much every option to ensure you did get every one of those other assets added in. Then I dumped the assets into a fresh copy of the project and yay it was like 400 Meg......
party time.png
If you've played Knight Shift Chapter 1 this image'll mean something to you. If not, that's also fine!

Forum statistics

Threads
117,269
Messages
1,105,999
Members
153,445
Latest member
sweetchi
Top