Quick time events?

So is there a way to make a quick time event, in other words, where the player has to press a certain key over and over to try and break out of an obstacle. (like in mad father when you go into the bathroom)
*bump*
Hi!


There's a lot of ways to do this, but here is the way I usually do it:

  • Set a variable to 0.
  • Make a loop.
  • In this loop check for a player button press via a conditionnal branch.
  • Each time the button is pressed add 1 to the variable and do whatever, play sound, shake the screen...
  • Then, with another conditional branch, check if the variable is >= to the number of times you want the player to press that button. If it is break loop.
  • Don't forget to add a small wait of 1 or 2 frames inside that loop.
Hi!


There's a lot of ways to do this, but here is the way I usually do it:

  • Set a variable to 0.
  • Make a loop.
  • In this loop check for a player button press via a conditionnal branch.
  • Each time the button is pressed add 1 to the variable and do whatever, play sound, shake the screen...
  • Then, with another conditional branch, check if the variable is >= to the number of times you want the player to press that button. If it is break loop.
  • Don't forget to add a small wait of 1 or 2 frames inside that loop.



Okay, also is there a way to make it that the player faces game over if they're too slow?
  • Set another variable to 0 before the loop.
  • Inside the loop add 1 to the variable.
  • Check if that variable has reached a suitable number that would be too log. The number itself depends on how much the wait inside the loop is. If you have a 1 frame wait, 60 would be one second.
  • If it has reached that number it means the player didn't complete the QTE in time so do whatever you want (trigger game over in your case).

Original thread: https://forums.rpgmakerweb.com/threads/quick-time-events.71150/