Page 1 of 1

Easier Calendar???

Posted: Sun Sep 15, 2013 1:46 am
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?

Re: Easier Calendar???

Posted: Sun Sep 15, 2013 3:21 am
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

Re: Easier Calendar???

Posted: Sun Sep 15, 2013 3:27 am
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?

Re: Easier Calendar???

Posted: Sun Sep 15, 2013 12:13 pm
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."

Re: Easier Calendar???

Posted: Sun Sep 15, 2013 1:01 pm
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

Re: Easier Calendar???

Posted: Sun Sep 15, 2013 1:33 pm
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:(

Re: Easier Calendar???

Posted: Sun Sep 15, 2013 1:39 pm
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

Re: Easier Calendar???

Posted: Sun Sep 15, 2013 6:32 pm
by dc19dc
Hi Elmiwisa, thank you for the option!