Character schedules. Fixed time-frames.

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
ISAWHIM
Veteran
Posts: 318
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

Character schedules. Fixed time-frames.

#1 Post by ISAWHIM »

Here is my situation. I have several characters that have a few schedules. The schedules change for various reasons.

I need an easy, or humanly manageable way to implement them. The issue I keep getting stuck on, is the times. For simplicity, I am using military time, but the day does not start until 05:00, or 5:00 A.M. for the characters, then it ends at 23:00 or 11:00 P.M. for everyone. (That is when I do my daily tabulations and plan to update the schedules.)

The variations for schedules are...
- Generic <-(The core schedule, used to "reset", before building the ones below.)
- School-days
- Vacation-days
- Weekends
- Work-days
etc...

They may have school and work, or work on a weekend, or work on vacation, etc... It is just a direct "replace" for those schedules. It replaces most contents directly. However, I also intend to modify other parts of the day, in certain situations.

Each set of values is used to modify a "daily" schedule. So, each MAY or MAY NOT have values that alter the players schedule. (I plan on using a formula to set some schedule changes too.)

A schedule, as "notebook data", looks like this... (Eg, what I have written in a physical notebook.)
05:00 [wake] <- {wake} is just a "tag" or a quick and dirty "group" of potential things being done, and/or location placement.
06:00 [Free]
07:00 [School]
08:00 [School]
09:00 [School]
...
...
21:00 [Free]
22:00 [Homebound]
23:00 [Sleep]

Examples of sub-schedules that take-place in a few areas. (I don't need help with this.)
EG: Wake = {get up[Bedroom/Bed]}, {shower[Bathroom/Shower]}, {get dressed[Bedroom/Dresser]}, {eat[Kitchen/Table]}
EG: Free = {long-list-of-stuff}
...

I know, there is a million ways to do something like this, but I hoped that someone who has had to deal with this, could chime-in with some aid.

I can't do "spans", because inserting changes would require tons of unwanted code. (Eg, [School= 07:00 to 15:00], then trying to insert something between the hours of 7:00 to 15:00.)

Characters are essentially doing "something" for an hour of time. (Or many things, which is handled by another set of code. Such as the school-classes, which also change, by day/hour.)

In any event. This is hanging me up, much longer than it should. I am internally combating the use of "classes", or "tuples", or "lists" or "dicts", or whatever... It is a pain trying to figure-out which is "Me friendly", "Python friendly", and also "RenPy friendly", all at the same time. Less on "Me", except for being able to edit the data, without needing some kind of index-system to figure things out.

My "game loop", looks like this... (Highly miniaturized)

Code: Select all

label Start_Day:
    #pre-start = end... "You are sleeping"
    #set and reset values
    #build daily schedule, set "special" changes
    #true "start"... "You wake-up, the alarm is buzzing."
    label Hour_Loop:
        #check if this is hour 23:00, jump Start_Day
        #check time, get schedule group... EG, [wake]
        #set sub-schedule events, or initiate "special" events... EG, Wake = {get up[Bedroom/Bed]}, {shower[Bathroom/Shower]}...
            #(PLAYER INTERACTION LOOP, HERE) <- Sub-schedules happen here... EG, Display="get up", Location=[Bedroom], Position=[Bed]
        #advance time, jump Hour_Loop

Post Reply

Who is online

Users browsing this forum: Bing [Bot]