Automatic Time Movement For Analog Clock?

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
ZaqazDeath
Regular
Posts: 46
Joined: Tue Nov 08, 2011 3:55 pm
Contact:

Automatic Time Movement For Analog Clock?

#1 Post by ZaqazDeath »

Umm... I'm a newbie for ren'py and I have a question. Is it possible to automatically move the time by 1 minute every second (real second) and it is used in the game?
For example, if the time was 8:00AM and a second passed in real life in the game it would automatically be 8:01AM and if I wanted to go to a gym that only opens at 10:00AM, it would not allow it?
http://www.renpy.org/wiki/renpy/doc/coo ... alog_Clock link for the analog clock im talking about... Umm.. thanks.

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Automatic Time Movement For Analog Clock?

#2 Post by Aleema »

I believe there was totally a thread about this that I remember replying to by Mugen. Ahhh ... Found it!
http://lemmasoft.renai.us/forums/viewto ... f=8&t=7257

Um, does that help, or did I misread the question?

DragoonHP
Miko-Class Veteran
Posts: 758
Joined: Tue Jun 22, 2010 12:54 am
Completed: Christmas
IRC Nick: DragoonHP
Location: Zion Island, Solario
Contact:

Re: Automatic Time Movement For Analog Clock?

#3 Post by DragoonHP »

Just append the ui.timer(60.0, clocktick, return=TRUE)
to
ui.timer(1.0, clocktick, return=TRUE)

ZaqazDeath
Regular
Posts: 46
Joined: Tue Nov 08, 2011 3:55 pm
Contact:

Re: Automatic Time Movement For Analog Clock?

#4 Post by ZaqazDeath »

Thanks. I'm pretty sure that it would work but for some reason, (Renpy ver 6.13.17.1646) it says minutes is not defined... Can you solve this too? :'( Thanks.

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Automatic Time Movement For Analog Clock?

#5 Post by Aleema »

That's an easy fix. Make sure you initialize minutes before the code that uses it starts. Like put $ minutes = 0 in an init block somewhere, and/or after the Start label.

ZaqazDeath
Regular
Posts: 46
Joined: Tue Nov 08, 2011 3:55 pm
Contact:

Re: Automatic Time Movement For Analog Clock?

#6 Post by ZaqazDeath »

thankkkssss (im the noobiest renpy user in the history of renpy. xD)

Post Reply

Who is online

Users browsing this forum: No registered users