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
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:

Persona-style animated calendar

#1 Post by Zetsubou »

So... I was playing Persona 4 (again) recently and thought to myself "Damn, the day to day transitions are pretty cool. I should make something like that."
And so I did.

https://github.com/koroshiya/python-calendar

In order to include the calendar in your project, grab the files from the renpy directory and paste them into your project's "game" folder.
That's pretty much it. To activate the calendar, you need to set a few variables and then jump to the calendar. eg.

Code: Select all

    $ dayofmonth = 2
    $ month = 1
    $ direction = 2
    $ label_cont = "chapter_01"

    jump calendar
The above would set the date to 2nd Feburary, show the calendar, move forward two days, then jump to the label chapter_01.
There are some other variables you can set (eg. the background, frame, buttons, delays, etc.). It's all documented in the calendar.rpy file.

I'll update it some more later. Current limitations include:
-resolution has been designed for and only tested with 800x600 Dimensions now scale. Resources for each resolution should reside within their own directories. eg. an 800x600 directory for resources to use when playing at that resolution.
-year and time currently not displayed Year, time and weather can now be displayed, if desired.
-weather/season not displayed
I haven't tested it thoroughly either. Everything works in the pygame version, so hopefully it's okay.

Also, I know that the current images being used don't really fit in.
The onyx and gray images are public domain images I was using in a medieval RPG, and the photo is one I took.
I'd like to replace all three, maybe have seasonal backgrounds.
For the time being, you can change all three images by setting the variables yourself inside of the calendar.rpy file. Just be mindful of the sizes until I do something about the resolution.
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

User avatar
peapodprincess
Regular
Posts: 52
Joined: Sat Jun 07, 2014 3:25 pm
Location: Pea Pod Principality
Contact:

Re: Persona-style animated calendar

#2 Post by peapodprincess »

This is really quite awesome. :)

Do you mind attaching a picture for those who are more visually oriented?

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

#3 Post by Zetsubou »

Glad you like it :)
I was planning on adding pictures, but it's hard to represent an animation with still pictures.
Regardless:

Before the animation begins:
Image

As the animation is just about to end:
Image

The animation has just ended:
Image

The year, time and weather are all optional.
The time and weather will slide down as the final transition (in this case, 21st to 22nd) begins.
The background in the above screenshots is the one I'm currently using, not the one included in the github repo.
The background, the buttons for the days, the frame around the current day, etc. are all easily customized.

The animation is simple: the days move across as time goes forward or back, and the month/year change accordingly.
If you're spanning multiple days, the animation starts fast and slows down as you near the last day.
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

User avatar
peapodprincess
Regular
Posts: 52
Joined: Sat Jun 07, 2014 3:25 pm
Location: Pea Pod Principality
Contact:

Re: Persona-style animated calendar

#4 Post by peapodprincess »

Thanks. I was having a hard time visualizing it because I've never played the Persona games, and you did a good job with the pictures.

Thanks a bunch for your hard work and effort!

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Persona-style animated calendar

#5 Post by gas »

I've tried your code and work fine... the first time.
Maybe I'm doing something wrong, but the next jump to the calendar start one day, one year and one month less than expected (thn go forward as expected).
I had to state again day, month, year variables each time? Uhm...
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

User avatar
Dragonstar89
Regular
Posts: 163
Joined: Mon Aug 12, 2013 11:28 pm
Projects: TBA
Organization: Self
IRC Nick: dstar89
Deviantart: senpai-jake
Skype: dstar_891
Location: West Virginia, USA
Contact:

Re: Persona-style animated calendar

#6 Post by Dragonstar89 »

This looks great and the code looks nice and structured as well. There's a lot of potential for this, I'll definitely be taking a look around it. With some more work on graphics and such, people can make some awesome things with this. It'll definitely help out my project which is time sensitive and set in a 5-month to get things done scenario.
Beginning pre-production work on a project in Renpy. After being away for 5 years, it's time to get back in the game 8)

Luckstar
Newbie
Posts: 3
Joined: Sun Jan 18, 2015 9:09 pm
Contact:

Re: Persona-style animated calendar

#7 Post by Luckstar »

Spent a good little while gushing about how useful, smooth and user friendly this script is.

Great work.

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

#8 Post by Zetsubou »

Sorry guys, I honestly haven't checked this thread at all since my last post :?

First off, I've attached to this post a modified version of the calendar that's intended to look more like a copy of the persona in-game calendar, rather than simply being inspired by it.
I was asked by Cube to help him adapt the script for a Persona fan game he's working on, so it needed to look like the original.

Image

The images are Cube's work. He says they're free for others to use; crediting is optional, but appreciated.

Second... as long as I'm not too busy at work in the near future, I'll try to start porting the calendar over to ATL.
It'll be much smoother and easier to use/maintain ;)
I'll get around to replacing the icons & default background at some point too. The only question is whether to commission the images, ask for help, or look for something CC-licensed.
Attachments
calendar.zip
Even more persona-style, done for/with Cube
(197.56 KiB) Downloaded 488 times
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

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

#9 Post by Zetsubou »

Okay, finally got around to porting the script to ATL. You can check it out here: https://github.com/koroshiya/python-cal ... /renpy-atl
Currently only in 1280x720, since that's the resolution of the game I'm working on.
It could use better icons, and the speed is currently static, but I think it's an improvement over the old script nonetheless.
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

User avatar
Luxliev
Veteran
Posts: 242
Joined: Sat Feb 07, 2015 11:01 am
Soundcloud: Luxliev
Contact:

Re: Persona-style animated calendar

#10 Post by Luxliev »

Nice one! Big Persona fan here. Really nice stuff here. Two question though.

1) Can I skip days or I have to go one after another.
2) Can you go back in time (day or skipping more than that at once)?

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

#11 Post by Zetsubou »

Luxliev wrote:Nice one! Big Persona fan here. Really nice stuff here. Two question though.

1) Can I skip days or I have to go one after another.
2) Can you go back in time (day or skipping more than that at once)?
You can skip ahead days by changing the dayofmonth/month/year variables.
eg.

Code: Select all

$ dayofmonth = 2
$ month = 1
$ direction = 2
$ label_cont = "chapter_01"

jump calendar
followed by

Code: Select all

$ dayofmonth = 8
$ direction = 2
$ label_cont = "chapter_02"

jump calendar
would go from the 2nd to the 4th, then skip 4 days and start the second animation at the 8th.

You can go back in time by using a negative direction. eg.

Code: Select all

$ direction = -1
would go back one day.
Skipping works the same going backwards as it does going forwards.
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

User avatar
Luxliev
Veteran
Posts: 242
Joined: Sat Feb 07, 2015 11:01 am
Soundcloud: Luxliev
Contact:

Re: Persona-style animated calendar

#12 Post by Luxliev »

Thanks for quick answer. Looking forward to implementing this code into my game.
Newest classical cover: Advance Wars - Sami Theme: https://www.youtube.com/watch?v=657Jt7hJRVc

Forum with my music: http://luxliev.proboards.com/

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

#13 Post by Zetsubou »

Currently implementing this in someone else's game, so I've updated the code a bit.
You can grab the latest code from GitHub.

The changes:
-fix an issue with the month changing when you run this script multiple times
-fix a similar issue with startDelay
-add a fade-in animation to the screen as a whole upon invocation
-removes the need to set a label and direction

The calendar is now invoked like this:

Code: Select all

label start:
    $ dayofweek = 1
    $ dayofmonth = 1
    $ month = 1

    "Alright, time to go to bed..."

    call calendar(2)

    "Woah! I slept all day Tuesday!?"
So the number of days to move, forward or backward, are passed into the calendar as a parameter.
There's no need for a label; the game continues on after the calendar is done.
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

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

#14 Post by Zetsubou »

Another update. The calendar now:
-uses screens instead of adding ui elements
-uses a single variable (calDate) to keep track of the date/time, instead of dayofweek, dayofmonth, etc.
-uses python's calendar object, so date numbers should be more accurate.
This also means the day/month names are derived from python, thus making the calendar language-neutral
-uses the "default" keyword, so Renpy 6.99+ is needed

One regression is that you can no longer set the day of the week; it is derived from the real date.
Also, I'll try to add speedier multi-day transitions in the near future. I had some difficulty getting the logic for dynamic speeds just right, so it's omitted for now.
Finally, I'll look at using non-absolute positioning in the future and try to make the calendar resolution/ratio-independent.

Using the previous example, you use this version like so:

Code: Select all

label start:
    $ calDate.replace(second=10, hour=12, minute=30, day=1, month=1, year=2014) #1st Jan 2014, 12:30:10 PM

    "Alright, time to go to bed..."

    call calendar(2)

    "Woah! I slept all day yesterday!?"
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

User avatar
Godline
Veteran
Posts: 499
Joined: Fri Jun 27, 2014 12:26 am
Completed: numerous
Tumblr: godlinegames
Deviantart: godline-games
itch: godline
Contact:

Re: Persona-style animated calendar

#15 Post by Godline »

Nice! You are awesome!

Post Reply

Who is online

Users browsing this forum: Google [Bot], MagicBuns