Real-Time events with Renpy

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
Gushi
Newbie
Posts: 24
Joined: Sun Apr 01, 2018 3:25 pm
Projects: Project 4th Wall
itch: https://umberbridge.
Contact:

Real-Time events with Renpy

#1 Post by Gushi »

So I was wondering if there is any way to implement a feature where the game tracks the computers time in real life and a certain event will happen in game during a certain amount of time, I'm not sure how I could describe it other than:

After 30 minutes pass something will happen, this event lasts for 15 minutes, after this timeframe this event will end, and it repeats like this until the person quits the game.

I was thinking about using this for an extra, secret route or something but for now I'm just kind of experimenting with Renpy and just want to know how to do cool things like this.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Real-Time events with Renpy

#2 Post by Imperf3kt »

Certainly possible by using python datetime.

Look herefor example usage.
viewtopic.php?f=8&t=51735&p=495270#p495270
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Gushi
Newbie
Posts: 24
Joined: Sun Apr 01, 2018 3:25 pm
Projects: Project 4th Wall
itch: https://umberbridge.
Contact:

Re: Real-Time events with Renpy

#3 Post by Gushi »

I already know how to do that, what I'm asking is how would I be able to make something available during a certain time and end after a certain amount of time.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Real-Time events with Renpy

#4 Post by Imperf3kt »

That module returns the time as a variable, so just treat it as such
Make a screen, slap in an 'if time is this, do this' and show the screen

I'd like to link you a better example, but cannot find it through both the search function, and google.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Andredron, Bing [Bot], Draida