Ren'Py QTEs[Solved]

ScrewMe

Active Member
Game Developer
Apr 11, 2018
528
1,351
Hey there, do you lads know how to set up QTEs in RenPy?
Basically, what I want is:
Scene plays. Then we get a QTE segment where arrow keys are used.
So it's like:
image1 -> showing a screen to player with button "K_LEFT" to be pushed to player on top of an image2->if player fails to react on time, show image 7, if not - image 8 -> showing a screen to a player with "K_RIGHT" needed to be pushed by player on top of image3 -> if player fails to react on time, show image 9, if not - image 10 ->showing a screen to player with button "K_UP" to be pushed to player on top of an image4 -> if player fails to react on time, show image 11, if not - image 12

Time required to hit the button is 3 secs, for example.
If player misses to hit the button on time more than 2 times, he's jumping to "bad_path"(that I've probably figured out, simply jumping to different label), if he doesn't - continue.

I wouldn't ask for your help, but tried looking at code of the games with QTEs and the thing is complicated and I can't get a thing.
Then I googled stuff at lemmasoft and everything's still complicated af. Now I'm just feeling stupid.

Maybe I'm just overly frustrated rn, but don't even know what to start with. The timer? The screens? How to check inputs? Ugh.
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
5,296
7,695
Python:
screen qte():
    modal True
    key "K_LEFT" action Jump("win")
    default timeleft = 1.0f
    timer timeleft action Jump("lose")

This is the simplest form.
modal True ensures the player can't click through or skip the event until it is completed.
K_Left is the key you press, the actions are the same as here: mine was just a quick example. You can array them too, with [ ].
default timeleft is a screen variable set to 1 second.
Timer documentation is here:
 
  • Like
Reactions: gojira667

ScrewMe

Active Member
Game Developer
Apr 11, 2018
528
1,351
Python:
screen qte():
    modal True
    key "K_LEFT" action Jump("win")
    default timeleft = 1.0f
    timer timeleft action Jump("lose")

This is the simplest form.
modal True ensures the player can't click through or skip the event until it is completed.
K_Left is the key you press, the actions are the same as here: mine was just a quick example. You can array them too, with [ ].
default timeleft is a screen variable set to 1 second.
Timer documentation is here:

Now that I see this, I fell even like a bigger dumbass that I couldn't get it myself. Jeez.
On the other hand though, is there a way not to make it jump one label to another after each section of QTE? Or I misunderstood something?
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
5,296
7,695
Now that I see this, I fell even like a bigger dumbass that I couldn't get it myself. Jeez.
On the other hand though, is there a way not to make it jump one label to another after each section of QTE? Or I misunderstood something?
I used jump as a quick example, but you can also call a label, or use any other action (or array of actions).
 
  • Like
Reactions: ScrewMe

osanaiko

Engaged Member
Modder
Jul 4, 2017
2,420
4,273
I used jump as a quick example, but you can also call a label, or use any other action (or array of actions).
While there is a lot of garbage in there, this thread on Renpy Forums has a LOT of examples of various games achievable in basic Renpy (screen language, as described by Winterfire above), Renpy "Creator-Defined Displayables" (CDD) , and even some with PyGame2 code mixed in.
 
  • Like
Reactions: ScrewMe