Small Press Button Error

I have an event that checks to see if the player presses the "C" button.

The event itself will work if the player presses the button at a moderate or slow pace, but if the player presses the key too quickly, the event breaks.

I have wait commands in place.

So, I was wondering if someone might be able to tell me what might cause such an error?

(I've included a screenshot of the revevant common events)

=====

I have several tiles, each tile is of a different character's face.  When the player (who looks like a cursor) steps on a tile, a variable called "Character" changes to 1, 2, 3 etc...

I'm using a script that activates the first common event whenever the C button is pressed.

When C is pressed, it checks to see what the variable "Character" is set to and puts a small text box graphic as well as a picture of a Circle (for yes) and an X (for no) in the middle of the screen, and the game displays text overtop of it.

It also activates another common event that allows the player to select between YES and NO and changes a variable called "Choice" to 1 or 2.

If the player presses the C button when this common event is active, and choice is = 1, it activates another common event that adds that character to the party and then deletes the images and ends the string of events.

If the player presses the C button when this common event is activate, and the choice = 2, it deletes the images and ends the string of events without adding the character to the party.

==============

It all works, just not when the character presses C  button too quickly.

 

Event.png
The problem with this condition is, that the "Button is being pressed" is only checked for the exact frame where the conditional branch is executed - it doesn't wait, and if the player presses one frame too late or too early (1 frame = 1/60 second) then the condition will be false.


Usually you need to check the button pressed in a loop, and use switches to prevent multiple presses from having multiple activations of the sequence.


The best option would be to make the check a parallel process common event that is called before the conditional branch sets a switch as to the result, and in your conditional branches you check the result and not the button pressed.


Sorry, I don't have time to make examples, and the exact event depends on what exactly you want to do.
Tsukihime has a script for "if button X pressed" then the event can be made to move on via labels.

Original thread: https://forums.rpgmakerweb.com/threads/small-press-button-error.40283/