[Solved] Date/time not progressing?

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
nanashine
Regular
Posts: 129
Joined: Thu Nov 30, 2017 1:44 pm
itch: renpytom
Contact:

[Solved] Date/time not progressing?

#1 Post by nanashine » Thu May 09, 2019 7:39 am

I have this code:

Code: Select all

init:
    $ import time

    $ year, month, day, hour, minute, second, dow, doy, dst = time.localtime()
    # dow = day of the week (Monday is 0 and Sunday is 6), doy = day of the year, dst = daylight saving time.    
    
    $ downames = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
    $ todays =  downames[(dow%7)]
    $ monthnames = ["December", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November" ]
    $ months =  monthnames[(month%12)]
And:

Code: Select all

screen timedaymonth:
    text "{size=28}[month]/[day]{/size}" xpos 635 ypos 0 
It was working normally before, but now time/date is not progressing at all. The weird thing is that I really didn't change anything in this code.

A lot of things on my game are based on the weekday, date, hour, etc and it doesn't "refresh"/progress unless you restart your phone.

Does anyone know what can be causing it?

Thanks.
Last edited by nanashine on Fri May 10, 2019 11:23 pm, edited 1 time in total.
I can't access my other account cause I don't remember the e-mail I used *cries in emoji*.

User avatar
Saa
Regular
Posts: 32
Joined: Tue Aug 20, 2013 7:11 pm
Tumblr: nipahgirl
Contact:

Re: Date/time not progressing?

#2 Post by Saa » Thu May 09, 2019 7:56 am

If you didn't change anything in this code, it's possible some other part of your code is affecting it.

User avatar
nanashine
Regular
Posts: 129
Joined: Thu Nov 30, 2017 1:44 pm
itch: renpytom
Contact:

Re: Date/time not progressing?

#3 Post by nanashine » Fri May 10, 2019 11:22 pm

Instead of using "import time" I'm using "import datetime", and now it's working properly hah
Thanks :)
I can't access my other account cause I don't remember the e-mail I used *cries in emoji*.

Post Reply

Who is online

Users browsing this forum: Google [Bot]