A Calendar

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

A Calendar

#1 Post by akemicchi »

I want to implement a calendar in my game, where the player can access it and review information on important dates by clicking on said date. I made an extremely simple one consisting purely of if-else statements and the ui.grid. Needless to say, it's bulky and inefficient, especially since I have to manually code each day, and also to which days are holidays/weekends/special dates... ^^; I was doing some research into Python, and I've decided it would be much better to create a calendar by defining Calendar as a class. Unfortunately, I have no idea how to define the attributes or how to set it up. @@; Most of the guides I've read have been too technical for me.

Ahaha, any help would be appreciated!

You know, having a calendar would be a really good extra for Ren'Py's cookbook. :) If someone has already made one, maybe they could share their secret?~

By the way, does anyone have any recommendations for tutorials or books on Python for dummies? Thanks again!

Kaihaku
Regular
Posts: 47
Joined: Fri Jan 04, 2008 10:10 pm
Location: Kampuchea
Contact:

Re: A Calendar

#2 Post by Kaihaku »

Possibly not for dummies but free and from the source...

http://docs.python.org/tut/

I downloaded a pdf form of it awhile ago and I thought it was pretty helpful.

User avatar
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

Re: A Calendar

#3 Post by akemicchi »

Hehe, yes, I've looked through that. It's really great; it has explained a lot. Thanks, Kaihaku!

Kaihaku
Regular
Posts: 47
Joined: Fri Jan 04, 2008 10:10 pm
Location: Kampuchea
Contact:

Re: A Calendar

#4 Post by Kaihaku »

How goes the calendar? I think you could implement it easily with a "dicitionary" data structure.

feburary = {'1': 'trip to the mall', '2': 'some art club event', '3': 'meet that girl from the art club', '5' : 'birthday party for mom', '7' : 'aunt mandy arrives from alaska'}

If you wanted more detail, you could work up a 'day' class but if one event a day suffices I'd think a dicitionary would be your best bet. Of course, it makes keeping track of things like day of the week, lunar cycles, work schedules, holidays, and such a bit more difficult...but implementing support for all of that might be more complicated than's necessary. I tend to lean more towards simulations over VNs, hence my preference for more detail than is tasteful or needed.

I was a bit distracted during my last reply else I would have been more in-depth. I'm also currently learning Python through Ren'py so my advice might not be the best, just as a disclaimer. That and I just picked up programming again after a year's hiatus so... Hopefully some less rusty and more experienced types will pop in. :)

Edit: I just reread over your post... I'm a scattered kind of person, apologizes... It's been helping me to look over the code in the 'Dating Sim Engine' to get a feel on how Ren'py intergrates with Python for something along these lines. You might download it and toy around with the code.

http://www.renpy.org/wiki/renpy/Frameworks

User avatar
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

Re: A Calendar

#5 Post by akemicchi »

Haha, the calendar is not going too well. I'm still trying to figure out what exactly to do, and what other alternatives I have.

But the dictionary! I haven't thought about that. I'm still a little hesitant in using that, because making a class seems a little easier in terms of creating the calendar template, but I'll definitely look into it more.

XD And I'm already using DSE.

Oh, does anyone know if there's any way to fill the ui.grid with a sequence of numbers without plugging numbers in individually? I was thinking the range function (like, range(1,30)) would be much, much easier, but... I'm not sure that would work?

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]