Easier Calendar???

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
dc19dc
Regular
Posts: 25
Joined: Mon Sep 02, 2013 1:17 am
Contact:

Easier Calendar???

#1 Post by dc19dc »

I'm trying, without success, to write a calender that only counts the days and months. I was using the code from the "slightly-complicated Digital Calendar" that Ren'Py has out, but I don't want the minutes. I hoping I could just use the day count that comes with the DSE. Has anyone seem something out there like this?

User avatar
Viobli
Regular
Posts: 66
Joined: Fri Jun 07, 2013 2:25 am
Projects: *Truly, Friends *Lady Eun-mi
Contact:

Re: Easier Calendar???

#2 Post by Viobli »

I did a bit of searching and here are some codes used by other people:
http://lemmasoft.renai.us/forums/viewto ... t=calendar //this includes season.
http://lemmasoft.renai.us/forums/viewto ... t=calendar //this includes location.
http://lemmasoft.renai.us/forums/viewto ... t=calendar //this seems to only include the day&month
Image

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: Easier Calendar???

#3 Post by Elmiwisa »

dc19dc wrote:I'm trying, without success, to write a calender that only counts the days and months. I was using the code from the "slightly-complicated Digital Calendar" that Ren'Py has out, but I don't want the minutes. I hoping I could just use the day count that comes with the DSE. Has anyone seem something out there like this?
What's wrong with simply removing the clock from that calendar?

dc19dc
Regular
Posts: 25
Joined: Mon Sep 02, 2013 1:17 am
Contact:

Re: Easier Calendar???

#4 Post by dc19dc »

Thank you Viobli, I like the 3 option best but now my day is always day 2 with no way to get past it. Elmiwisa I like the "slightly-complicated Digital Calendar" but when I tried removing the minutes it just broke the code.

Here is what I'm using now, and i'm stuck. It always shows day 2.

Code: Select all

    jump day

label day:

    $ month = 1
    $ day = 1
    $ day_max = 31
    
if month == 2:
    $ day_max = 28
elif month == 4 or month == 6 or month == 9 or month == 11:
    $ day_max = 30
else:
    $ day_max = 31
    
if day == day_max:
    $ day = 1
    if month == 12:
        $ month = 1
    else:
        $ month += 1
else:
    $ day += 1

    "It's day %(day)d, month %(month)d."

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: Easier Calendar???

#5 Post by Elmiwisa »

No no no, removing the Clock, not the minutes.
Look at the end:

Code: Select all

screen say:
    if(clock):
        $ Calendar()
        $ Clocks()    #<---remove this line
To advance to the next day, add 60*24=1440 to minutes:

Code: Select all

$minutes+=1440

dc19dc
Regular
Posts: 25
Joined: Mon Sep 02, 2013 1:17 am
Contact:

Re: Easier Calendar???

#6 Post by dc19dc »

Elmiwisa wrote:No no no, removing the Clock, not the minutes.
Look at the end:

Code: Select all

screen say:
    if(clock):
        $ Calendar()
        $ Clocks()    #<---remove this line
To advance to the next day, add 60*24=1440 to minutes:

Code: Select all

$minutes+=1440
Elmiwisa, if I remove that will it allow me to work within 5 dp_period (6 if you count the night period)? I just want the day to advance after the 6 periods to end. I didn't see the need for minutes or the clock. Sorry for being confusing:(

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: Easier Calendar???

#7 Post by Elmiwisa »

dc19dc wrote:
Elmiwisa wrote:No no no, removing the Clock, not the minutes.
Look at the end:

Code: Select all

screen say:
    if(clock):
        $ Calendar()
        $ Clocks()    #<---remove this line
To advance to the next day, add 60*24=1440 to minutes:

Code: Select all

$minutes+=1440
Elmiwisa, if I remove that will it allow me to work within 5 dp_period (6 if you count the night period)? I just want the day to advance after the 6 periods to end. I didn't see the need for minutes or the clock. Sorry for being confusing:(
The purpose of that Clock() line is to show the hours and minutes. Removing it make them make the hours and minutes no longer get shown.
There are a lot of way to fix thing really. I am just telling you the way that involve the least amount of modification to the original code.
Remember that 1440/6=240. So to advance by 1 period, just do

Code: Select all

minutes+=240

dc19dc
Regular
Posts: 25
Joined: Mon Sep 02, 2013 1:17 am
Contact:

Re: Easier Calendar???

#8 Post by dc19dc »

Hi Elmiwisa, thank you for the option!

Post Reply

Who is online

Users browsing this forum: Kia, Sirifys-Al