Persona-style animated calendar

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
monyarm
Newbie
Posts: 4
Joined: Sun Sep 06, 2015 6:43 am
Deviantart: monyarm
Github: monyarm
Skype: mony_a99
Contact:

Re: Persona-style animated calendar

#16 Post by monyarm »

How difficult would it be to modify the script to have a overlay in the upper right corner with the date , time , moon phase (something ill have to set manually since i don't think this script has it), and have the time instead of be exact numerical time be
morning
evening
dark hour
and such

User avatar
Zetsubou
Miko-Class Veteran
Posts: 522
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: Persona-style animated calendar

#17 Post by Zetsubou »

Sounds simple enough.
For the overlay on the top right, you could just hijack the year and/or month screens.
And for the time, either use if statements to compare the time to different periods of the day, or replace the time screen with something you set manually.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Sable's Grimoire 2

https://zetsubou.games

monyarm
Newbie
Posts: 4
Joined: Sun Sep 06, 2015 6:43 am
Deviantart: monyarm
Github: monyarm
Skype: mony_a99
Contact:

Re: Persona-style animated calendar

#18 Post by monyarm »

i tried to remove the th , nd , rd from the end of the dates so that they display without them , but if i put too high of a value in call calendar() like 90 (i need to skip roughly 3 months of time) i get the following exception
http://pastebin.com/wik58NjG

also i extended the CBtn screens , adding ones upto 12 , and if i go forward a small value there arent any problems

User avatar
Zetsubou
Miko-Class Veteran
Posts: 522
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: Persona-style animated calendar

#19 Post by Zetsubou »

monyarm wrote:i tried to remove the th , nd , rd from the end of the dates so that they display without them , but if i put too high of a value in call calendar() like 90 (i need to skip roughly 3 months of time) i get the following exception
http://pastebin.com/wik58NjG[/code]

Remove " + [newVal % 10 - 1]" from the method.
Rather, you should be able to remove the if statement and just return "str(newVal)".
monyarm wrote:also i extended the CBtn screens , adding ones upto 12 , and if i go forward a small value there arent any problems
What problem do you encounter if you go up larger values?
Since you're adding more CBtn screens, you'll need to keep coordinates in mind.
The current coordinates used were to fit approx 7 buttons of 220px width on a 1280px wide screen.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Sable's Grimoire 2

https://zetsubou.games

monyarm
Newbie
Posts: 4
Joined: Sun Sep 06, 2015 6:43 am
Deviantart: monyarm
Github: monyarm
Skype: mony_a99
Contact:

Re: Persona-style animated calendar

#20 Post by monyarm »

Zetsubou wrote:What problem do you encounter if you go up larger values?
Since you're adding more CBtn screens, you'll need to keep coordinates in mind.
The current coordinates used were to fit approx 7 buttons of 220px width on a 1280px wide screen.
The problem i encountered was the exception i gave a pastebin to , and my main reason of adding more CBtn screens is to that as it scrolls through them they keep showing up , cause before i added the new ones it went only up to the 12th (my game starts on the 7th) and theres some empty space after that
also i just tested it and it seems 12 is the magic number for 1080p displays , after doing what you suggested it now keeps going as it should even if i tell it some outrageous number like 60 days ,
http://imgur.com/5XmA3JL this is what ive currently made it look like
also id like to ask 3 things
1st how do i make it so that the number of the month apears between the year and name of the month
2nd how do i make it so that specific days and dates (saturdays 1 color , sundays another , and specific dates another) are colored differently
3rd how do i make it so that if it has to advance more than a single day it advances them at once , instead of doing it one by one and pausing for a split second at each

trismegistus
Newbie
Posts: 7
Joined: Mon Jul 04, 2016 4:02 pm
Contact:

Re: Persona-style animated calendar

#21 Post by trismegistus »

I'm not sure whether this is me misunderstanding something or a mistake in the documentation, but when I follow the provided instructions, the date doesn't get set correctly. It always starts from the default date that's hard-coded into calendar.py, regardless of what date I tell it to use.

It looks like the problem is that datetime.replace doesn't modify the existing object; it just returns a new one. So in order to save my new date, I had to do:

Code: Select all

$ calDate = calDate.replace(second=10, hour=12, minute=30, day=2, month=7, year=2012)
...rather than just

Code: Select all

$ calDate.replace(second=10, hour=12, minute=30, day=2, month=7, year=2012)
as shown in the documentation. It seems to work as expected if I make that change.

Just thought I should point that out in case anybody else runs into the same problem and googles this thread.

User avatar
Zetsubou
Miko-Class Veteran
Posts: 522
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: Persona-style animated calendar

#22 Post by Zetsubou »

Thanks trismegistus,

I've updated the documentation in calendar.rpy in renpy-6.99.

I haven't looked at or checked the calendar for a while, and it should be considered unsupported.
Ultimately I wound up ditching the animations and just using a very small section of the code for time management in my own games, so development stopped.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Sable's Grimoire 2

https://zetsubou.games

city
Newbie
Posts: 23
Joined: Mon Jul 04, 2016 6:30 pm
Contact:

Re: Persona-style animated calendar

#23 Post by city »

Hi there, I've spent a few hours looking around the forums, but only found more complex calendars.

I'm hoping to add an overlay (I think that's what it's called) to the top left that just shows a day counter (day 1, day 2, day 3, etc...). I assume I'll need an image to go alongside it. Can anyone suggest a code that would work?

I'm already calculating days with:

Code: Select all

$ day = 0
I just need a way to display it.

Thanks in advance!

wolfbloodrei
Newbie
Posts: 3
Joined: Sun Aug 21, 2016 11:27 pm
Contact:

Re: Persona-style animated calendar

#24 Post by wolfbloodrei »

I know this might seem a little bit late and you said it should be considered unsupported, but I have a couple of questions. o-o

I'm able to get the calendar working, but I can't get it to correctly show the events I'm setting.

For example:

https://i.gyazo.com/ab33690d68e3276d485 ... 01c9f5.png

I have it set so that certain events show up on the calendar like holidays and birthdays, and for the most part that works.

My problem seems to be that the events of the first month repeat themselves in the second one, no matter how I code it.

This is the code:
https://i.gyazo.com/6242eb54231c9a9a8c1 ... c2299d.png

I know I should be using the calendar script that's most recent, but I don't know how to do this sort of thing with that. Or fix the new resolution to fit the images I've already made. o-o Is it possible to do those things, and if so how do I do them?

User avatar
Eirrir
Regular
Posts: 81
Joined: Mon Feb 27, 2017 7:16 pm
Projects: Operation: Future Domination
Tumblr: Eirrir
itch: eirrir
Contact:

Re: Persona-style animated calendar

#25 Post by Eirrir »

What code should I use to make it so that, on a specified day, there's a different button icon that I made (similar to the Persona weather icons)?

User avatar
Sayumi101
Veteran
Posts: 233
Joined: Fri Apr 11, 2014 1:56 am
Completed: Closing Spaces, Pastel Rain, Straight Up: Sister-zoned!, Run 'N Gun
Projects: Hunta-H ~Romancing Idols~
Deviantart: Sayumi101
itch: sayumi101
Location: India
Contact:

Re: Persona-style animated calendar

#26 Post by Sayumi101 »

These calendar codes are amazing and are working like dream.
I'll be using it in my NaNoReNo'17 project, so just wanted to drop by and say thanks.
ImageImageImage

Post Reply

Who is online

Users browsing this forum: No registered users