Working with time variables

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
Uy27
Regular
Posts: 29
Joined: Wed Apr 04, 2018 2:07 am
Contact:

Working with time variables

#1 Post by Uy27 »

So I have this very simple code

Code: Select all

     define day = 1
 
    $ day_number = (day%7)
    $ day_name_values = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
    $ day_name = day_name_values[day_number]
    $ dayTime_number = (dayTime%6)
    $ dayTime_name_values = ("Morning", "Noon", "Afternoon","Evening", "Night", "Late Night")
    $ dayTime_name = dayTime_name_values[dayTime_number]
Now, the simple things as day += 1 etc work fine.
But I have a hard time making it usable besides that.
Example, wanting something to happen every 7 days.
Or need to wait +4 days from the current day for something to happen.

I guess I need another variable but I simply cannot figure what that would be.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Working with time variables

#2 Post by trooper6 »

Might you, perchance, be looking for something like quirien's Dating Sim Engine?
viewtopic.php?f=51&t=31571
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

Uy27
Regular
Posts: 29
Joined: Wed Apr 04, 2018 2:07 am
Contact:

Re: Working with time variables

#3 Post by Uy27 »

Hello trooper6. I just want to say a quick thanks. I remember when I was making my game that I saw your other post (while helping others) that also solved my own issues. So big thanks for that.

Anyway, I have seen through all the dating sim scripts, but sadly none that I could find (maybe due to my lack of coding experience) which would help me.
It should be noted that my game is using the navigation system, so it's a very free roam style of game with labels as rooms etc.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider]