[SOLVED] Can keyboard input be timed?

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
Ivlivs
Veteran
Posts: 267
Joined: Sun Feb 25, 2007 1:00 pm
Contact:

[SOLVED] Can keyboard input be timed?

#1 Post by Ivlivs »

Can you set it up so that if you don't type something in on time, something happens?
Last edited by Ivlivs on Mon Oct 07, 2013 4:34 pm, edited 1 time in total.
Jitteh Dawn --- A VN by Ivlivs

User avatar
jesusalva
Regular
Posts: 88
Joined: Mon Jul 22, 2013 5:05 pm
Organization: Software in Public Interest, Inc.
IRC Nick: jesusalva
Github: pazkero
itch: tmw2
Location: Brazil
Discord: Jesusalva#4449
Contact:

Re: Can keyboard input be timed?

#2 Post by jesusalva »

Yes.

Code: Select all

    $ ui.timer(6.0, ui.jumps("verybad"))
    $ value = renpy.input("INPUT SOMETHING!!!")
    "Yeah, you've wrote [value]."
so, ui.timer() start a timer, the first value is the time to wait (6.0 seconds), the second is what to do.
I placed ui.jumps() , that jump to a label, in that, the label "verybad".

I didn't tested with Keyboard Inputs, only with menus, so I can't say if it works.
Jesusaves/Jesusalva

Ivlivs
Veteran
Posts: 267
Joined: Sun Feb 25, 2007 1:00 pm
Contact:

Re: [SOLVED] Can keyboard input be timed?

#3 Post by Ivlivs »

It worked! Thanks, Jesusalva. :)
Jitteh Dawn --- A VN by Ivlivs

User avatar
jesusalva
Regular
Posts: 88
Joined: Mon Jul 22, 2013 5:05 pm
Organization: Software in Public Interest, Inc.
IRC Nick: jesusalva
Github: pazkero
itch: tmw2
Location: Brazil
Discord: Jesusalva#4449
Contact:

Re: [SOLVED] Can keyboard input be timed?

#4 Post by jesusalva »

You're welcome.
Anything else, just ask.
Jesusaves/Jesusalva

User avatar
PN04
Regular
Posts: 34
Joined: Thu Oct 07, 2010 4:46 am
Contact:

Re: [SOLVED] Can keyboard input be timed?

#5 Post by PN04 »

...O_O I can see it now! Asura's Wrath: the visual novel!
Well not exactly but I have always wondered if I could add a little action to a standard VN by adding timed choices that result in bad outcomes if you dont react in time rather than just choosing the wrong option. Sort of like Dragon's Lair, but then again I guess that's kinda the original quick time event game anyway.

Post Reply

Who is online

Users browsing this forum: kedta35, Ocelot