Ren'Py - structure for week and calendar scheules

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
Zenathos815
Newbie
Posts: 6
Joined: Wed Sep 06, 2017 3:42 pm
Contact:

Ren'Py - structure for week and calendar scheules

#1 Post by Zenathos815 »

Hi! I'm zen and I am working on a game that I plan to implement a week, day, and possibly month schedule where each intractable character will be present at certain locations at certain times on each day. There are 7 characters the player can interact with but I am trying to plan the best way to structure my schedule system so that I can include special events every few days or weeks.

I have a pretty workable day schedule at the moment but I was thinking of breaking it up into weeks as well so that say week 4 will contain an event that wouldn't be available for weeks 1-3 but then loops back around to week 1. Then using this to structure different acts in the story. I was thinking it might be similar to the day system I am exploring. But I wanted to see if this was possible or if there are better ways to accomplish such

Thanks!

TheChatotMaestro
Regular
Posts: 91
Joined: Mon Jul 31, 2017 8:33 am
Deviantart: LedianWithACamera
Contact:

Re: Ren'Py - structure for week and calendar scheules

#2 Post by TheChatotMaestro »

I have no idea what you're working with, but I've got a similar thing going on in my game with the DSE engine! What I do is I have two variables going around- one to determine what week it is, and one to determine what day of the week it is. Certain events, when it's day X of week Y, will take priority over others, and show up when they're supposed to!
But I only know how to make this work with the DSE.
I'm not sure how your events work, but try something similar to having it show up with higher priority when the variables match up!

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Ren'Py - structure for week and calendar scheules

#3 Post by Remix »

I am working on an engine to handle time based events that should be ready in a few days (depending on work) which basically registers each event label into the engine with parameters dictating availability.

Code: Select all

label some_event:
    register event:
        caption "Do the 'some event' event"
        hour "12 to 15"
        weekday ['Monday', 'Wednesday']
        day [range(1,6), range(22,24)]
        month "Feb"
        func test_event_location "lake"
As time progresses, the engine can easily calculate if a certain event is available, returning true/false for tests or lists of available events etc.
Just needs some more polishing before I add it to the cookbook

An old example of the code is here . The version I plan to add to cookbook (once done) is a lot more extensible though.
Frameworks & Scriptlets:

Zenathos815
Newbie
Posts: 6
Joined: Wed Sep 06, 2017 3:42 pm
Contact:

Re: Ren'Py - structure for week and calendar scheules

#4 Post by Zenathos815 »

I dig it. Do you think that it would integrate well with week/month schedule?

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Ren'Py - structure for week and calendar scheules

#5 Post by Remix »

Zenathos815 wrote: Tue Sep 12, 2017 1:38 pm I dig it. Do you think that it would integrate well with week/month schedule?
Currently the main class handles storing and progression of a minute value, all other counts (hour, day, weekday, week, month) are calculated from or relative to that minute value.
Events (each one is a label) registered to the class can then define exactly when they 'can' occur. An event could, for example, say it can occur on Tuesdays between 10am and 2pm if the day is between 1 and 7 and the month is September.
I still have some work to do on it, tweaking the lexer to interpret the init and register tags, add more functionality etc. (such as, event saying it can only be accessed n times or n times per week, events saying a set duration must pass between each access etc)

The facility also allows events to register an external function (with *args and **kwargs) which should return True or False.

To integrate into your game, you would want one or more functions like that:
Test location -- Take Cindy to Cinema -- True if location is City, else False
Test Acquaintance -- Take Cindy to Cinema -- True if character has already met Cindy

Once I have the code finished I will expand upon that brief summary with some actual code snippets and examples.
Now to find the time to get the code done :)
Frameworks & Scriptlets:

Zenathos815
Newbie
Posts: 6
Joined: Wed Sep 06, 2017 3:42 pm
Contact:

Re: Ren'Py - structure for week and calendar scheules

#6 Post by Zenathos815 »

I'd love a link when you are done :)

I'm still new to things and I am too stubborn for total frameworks so tricks like that help lots

Zenathos815
Newbie
Posts: 6
Joined: Wed Sep 06, 2017 3:42 pm
Contact:

Re: Ren'Py - structure for week and calendar scheules

#7 Post by Zenathos815 »

I think I have decided a bit more on how I would like to do this. Since I have a really nice day and week structure in place i might just use my "months" as labels because I'm not necessarily trying to track time outside of what day it is and what 4 Week block you are currently on I just wanted the month cycle to be looped until the player meets the requirements to move to the next cycle. So as long as I am tracking weeks 1-4 and day 1-7 per week I was going to make each month cycle it's own script that will loop unless the requirements have been met. Kinda like every month isn't so much it's own month but like you unlock the next episode

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Ren'Py - structure for week and calendar scheules

#8 Post by Remix »

It sounds like you have your game mechanics pretty well thought out already :)
I think it may be best to continue along your own concept for the time being and then maybe check out my framework once it is released and see if it or parts of it can be implemented ... or just use it to give yourself more ideas.

Progression on my event framework is going well, though without the rush to get it done too quickly I can take a little more time to polish the rougher edges.

I will post a link once done anyway.
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: No registered users