QTE (Quick Time Event)

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
TyranX
Regular
Posts: 58
Joined: Tue Jan 05, 2010 3:44 am
Location: New York
Contact:

QTE (Quick Time Event)

#1 Post by TyranX » Mon Jul 26, 2010 5:27 pm

My question would be how would I implement a sort of QTE event using Renpy? I'd like to find a way that would accept as an input a certain specific button press within the event.

Example: QTE activates for 5 seconds, user needs to press 'A' within that time, if successful event plays, if not, other event plays.

If specific buttons are not possible for input, how would I do QTE using choices?
Example: QTE activates, user needs to choose a choice before time runs out and choices disappear.
"Never argue with an idiot. They will bring you down to their level and beat you to death with their experience."

Current Status="A brilliantly lazy man"

User avatar
PyTom
Ren'Py Creator
Posts: 15445
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: QTE (Quick Time Event)

#2 Post by PyTom » Mon Jul 26, 2010 5:43 pm

Use screens.

Code: Select all

screen timeout_event:
    key "a" action Jump("pressed_a")
    timer 5.0 action Jump("timed_out")

call screen timeout_event
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
TyranX
Regular
Posts: 58
Joined: Tue Jan 05, 2010 3:44 am
Location: New York
Contact:

Re: QTE (Quick Time Event)

#3 Post by TyranX » Thu Jul 29, 2010 11:46 pm

Thank you for that piece of code, I've leaned how to implement it but there is an issue now.

How do I get the the screens to become their own entities since I have multiple of these throughout my entire script. In case I'm wording this wrong heres the problem.
Whenever I go through the very first screen event, it will only accept the very last screen results inputs and proceed to use those jump coordinates.

Call/Run screen 1 -> Only accepts screen 6's 'correct' input -> jumps to screen 6's pass/fail labels.

And while I'm on the topic, If I wanted text to show during the event (Ex:"Press 'a'!"), at which part of the code would I place it?


EDIT:
I realize what might be my problem >_< I should of checked it out before I posted this, let me go try it first.
"Never argue with an idiot. They will bring you down to their level and beat you to death with their experience."

Current Status="A brilliantly lazy man"

User avatar
TyranX
Regular
Posts: 58
Joined: Tue Jan 05, 2010 3:44 am
Location: New York
Contact:

Re: QTE (Quick Time Event)

#4 Post by TyranX » Fri Jul 30, 2010 12:09 am

Ok, Ive fixed my previous mistake. It seems that I had left all the screen names the same thinking that timeout_event was a renpy keyword. (Thats what I get for using notepad D:) I fixed that and gave them their own appropriate names, eliminating my problem.

But additionally, I still need to know, How do I get text to display in center or any other position on screen, DURING the timeout screen event?
"Never argue with an idiot. They will bring you down to their level and beat you to death with their experience."

Current Status="A brilliantly lazy man"

User avatar
shahab96
Veteran
Posts: 228
Joined: Mon May 24, 2010 5:40 am
Location: Lahore, Pakistan
Contact:

Re: QTE (Quick Time Event)

#5 Post by shahab96 » Fri Jul 30, 2010 3:59 am

Have you considered putting your text inside a frame and making the frame transparent? then you could put the frame wherever you want and it would be the same thing. Or you could make the frame in some color or put a background in it, Your choice.
The true measure of a man is what he does with his power.

Post Reply

Who is online

Users browsing this forum: EOWNERDEAD, hapciupalit