Help with Calendar Dates, adding and subtracting
Posted: Mon May 09, 2022 11:06 pm
Hello Everyone!
I am currently creating a game that will add and subtract time from a calendar date based on the answers given to questions.
I found a few helpful posts here: viewtopic.php?f=8&t=37939
and here: viewtopic.php?t=60773
Unfortunately, both of them seemed to have some issues with the code and would error out when I play tested. I do have a good DOB entry code that works, performs limited validation and at least returns the correct formatted entry here:
However, now that I see it again, that's just entering numerical values and not really pulling a date. Is there a way I can convert this to a date-represented integer within Renpy? I know it can be done in python but I'm really new at this and unsure how it would integrate into Renpy.
Thank you all in advance for any assistance you can provide!
I am currently creating a game that will add and subtract time from a calendar date based on the answers given to questions.
I found a few helpful posts here: viewtopic.php?f=8&t=37939
and here: viewtopic.php?t=60773
Unfortunately, both of them seemed to have some issues with the code and would error out when I play tested. I do have a good DOB entry code that works, performs limited validation and at least returns the correct formatted entry here:
Code: Select all
init python:
import datetime
$ y = renpy.input("Year of your birth (4 digits):", allow ="0123456789" ,length =4)
$ m = renpy.input("Month of your birth (2 digits):", allow ="0123456789",length= 2)
$ d = renpy.input("Day of your birth (2 digits):", allow ="0123456789", length= 2)
$ dob = "{0}/{1}/{2}".format(m, d, y)
e "Your DOB is [dob]"Thank you all in advance for any assistance you can provide!