- Jun 17, 2017
- 5,852
- 29,774
If you are just displaying the current day, but want a date system, take a look at Lab Rats (the first one). It's been a while, but I did some personal tweaking under the hood there, and it had not only a day system, but also had multiple time periods for each day.Anyone who knows their way around Renpy?
I kinda need a calender system in my game (monday to sunday, also counting months).
Need it for my D game ^^
I haven't peeked under the hood of Lab Rats 2, so I don't know what calendar system Vren is using for that.
There's probably an old post here somewhere, in which I mentioned a 'cleaner' way to code the day of week variables in LR, but it's been a long while since I was following that game.
Edit: OK, so to 'parse out' the day of week from the current day:
Code:
$ day_number = (day%7)
$ day_name_values = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
$ day_name = day_name_values[day_number]
Then just use day_name in your UI to display Sunday, etc.
LR1 didn't bother with months, but you could do something along the lines of
'if day < 32, Month = July, day_displayed = day - 3
if 31 < day < 63, Month = August, day_displayed = day -34
etc.'
Using proper 'if' statement coding of course! It's been too long since I messed with Renpy.
So, using the above variables, and assuming that start day is 3 (or 4), since July 1 falls on a Wednesday this year, to display:
Saturday, July 3rd
you'd arrange the variables as follows in your UI
day_name, month, day_displayed
would generate that string (if properly coded in Renpy, of course).
OR, you could just re-arrange the day_name_values string to start on Wednesday instead of Sunday for Day 1, and lose the -3 adjustment on the day displayed thing...
If you are looking for a displayable calendar, that's a different story. I'd suggest posting up in the Programming and Development thread with what you are looking for - I'm sure that people will have a few ideas.