Help with simple calender. Please. (Solved)

Forum organization and occasional community-building.
Forum rules
Questions about Ren'Py should go in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
scarecrow-76
Newbie
Posts: 8
Joined: Mon Nov 08, 2021 9:32 pm
Projects: Hussies of Pleasureville
IRC Nick: Scarecrow-76
itch: Scarecrow-76
Contact:

Help with simple calender. Please. (Solved)

#1 Post by scarecrow-76 »

Following Game Developer Training on youtube and coded a calendar. Changed a few things. So instead of minutes and hours, it goes from morning, afternoon, evening, to night. Everything works well enough. But when it reaches the end of the week, the date doesn't go to Mon the 8th. Instead it goes to Mon the 1st. I cant find a difference between his code and mine. Now, if I keep the click going, the months will change correctly. Its just the date of the day that resets after a week. The minutes and hour variables are in there, but Im not using them.

Code: Select all

label start:
    call variables
    $ GameRunning = True
    while GameRunning:
        $ Output = Months[Month] + ". " + str(Day+1) + ", " + WeekDays[Day] + " " + TimeDays[TimeDay] #+ " " + str(Hours) + ":" + str(Minutes)

        "Click"

        $ TimeDay += 1
        if TimeDay >= 4:
            $ TimeDay = 0
            $ Day += 1
            $ Days += 1
        if Day > 6:
            $ Day = 0
        if Days > MonthDays[Month]:
            $ Month += 1
            $ Days = 0
        if Month > 11:
            $ Month = 0
        #call EventCheck
    return




label variables:

    $ WeekDays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
    $ Months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"]
    $ MonthDays = [30, 28, 30, 30, 30, 29, 30, 30, 29, 30, 29, 30]
    $ TimeDays = ["Morning", "Afternoon", "Evening", "Night"]
    $ Minutes = 0
    $ Hours = 12
    $ Month = 0
    $ Day = 0
    $ Days = 0
    $ TimeDay = 0

    return
Last edited by scarecrow-76 on Mon Oct 24, 2022 4:27 pm, edited 1 time in total.

Corynth
Regular
Posts: 66
Joined: Thu Dec 01, 2011 7:59 am
Completed: Halloween Otome, Valentines Otome
Projects: Christmas Otome
Organization: Synokoria
Tumblr: synokoria
Deviantart: Corynth-Synokoria
itch: synokoria
Contact:

Re: Help with simple calender. Please.

#2 Post by Corynth »

You're using Day (of the week) instead of the Days variable that counts days of the month:

Code: Select all

while GameRunning:
        $ Output = Months[Month] + ". " + str(Day+1) + ", " + WeekDays[Day] + " " + TimeDays[TimeDay] #+ " " + str(Hours) + ":" + str(Minutes)
Changing it to str(Days+1) should fix it.

scarecrow-76
Newbie
Posts: 8
Joined: Mon Nov 08, 2021 9:32 pm
Projects: Hussies of Pleasureville
IRC Nick: Scarecrow-76
itch: Scarecrow-76
Contact:

Re: Help with simple calender. Please.

#3 Post by scarecrow-76 »

Corynth wrote: Mon Oct 24, 2022 1:38 pm You're using Day (of the week) instead of the Days variable that counts days of the month:

Code: Select all

while GameRunning:
        $ Output = Months[Month] + ". " + str(Day+1) + ", " + WeekDays[Day] + " " + TimeDays[TimeDay] #+ " " + str(Hours) + ":" + str(Minutes)
Changing it to str(Days+1) should fix it.
Thank you so much!! I knew I was using one of them wrong somewhere. Thank you again!!! :D

Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot]