Can Events/Activities be triggered based on real life time?

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
Kokoro Hane
Eileen-Class Veteran
Posts: 1237
Joined: Thu Oct 27, 2011 6:51 pm
Completed: 30 Kilowatt Hours Left, The Only One Girl { First Quarter }, An Encounter ~In The Rain~, A Piece of Sweetness, Since When Did I Have a Combat Butler?!, Piece by Piece, +many more
Projects: Fateful Encounter, Operation: Magic Hero
Organization: Tofu Sheets Visual
Deviantart: kokoro-hane
itch: tofu-sheets-visual
Contact:

Can Events/Activities be triggered based on real life time?

#1 Post by Kokoro Hane »

Hello!

I was wondering if there was a code to check the player's real time (based on the player's computer clock) to use to trigger certain events? For example, I wanted to simulate having dailies, so certain activities you can do once every day, but then have it reset at a certain time.

For example, let's say you can do 1 jigsaw puzzle a day. After you do the puzzle, it will be unavailable until it resets again at 12 am local time. Is this possible? Also if it is possible to check calendar, to simulate weeklys, could this also be done by checking if it's a specific day and have it be unavailable until that specific day comes again? Thanks!
PROJECTS:
Operation: Magic Hero [WiP]
Piece By Piece [COMPLETE][Spooktober VN '20]
RE/COUNT RE:VERSE [COMPLETE][RPG]
Since When Did I Have a Combat Butler?! [COMPLETE][NaNoRenO2020+]
Crystal Captor: Memory Chronicle Finale [COMPLETE][RPG][#1 in So Bad It's Good jam '17]

But dear God, You're the only North Star I would follow this far
Owl City "Galaxies"

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Can Events/Activities be triggered based on real life time?

#2 Post by _ticlock_ »

Kokoro Hane wrote: Thu Dec 22, 2022 9:31 pm I was wondering if there was a code to check the player's real time (based on the player's computer clock) to use to trigger certain events?
You can use time or datetime libraries for that. Here are some examples:
viewtopic.php?f=8&t=40687&p=430540#p430540
viewtopic.php?f=8&t=37939#p410599
viewtopic.php?f=51&t=47774
Although a player can cheat, changing the system time. You can try to avoid it by checking the internet time.
viewtopic.php?f=8&t=65745&p=556806&hili ... me#p556795

User avatar
Kokoro Hane
Eileen-Class Veteran
Posts: 1237
Joined: Thu Oct 27, 2011 6:51 pm
Completed: 30 Kilowatt Hours Left, The Only One Girl { First Quarter }, An Encounter ~In The Rain~, A Piece of Sweetness, Since When Did I Have a Combat Butler?!, Piece by Piece, +many more
Projects: Fateful Encounter, Operation: Magic Hero
Organization: Tofu Sheets Visual
Deviantart: kokoro-hane
itch: tofu-sheets-visual
Contact:

Re: Can Events/Activities be triggered based on real life time?

#3 Post by Kokoro Hane »

_ticlock_ wrote: Fri Dec 23, 2022 12:10 am
Kokoro Hane wrote: Thu Dec 22, 2022 9:31 pm I was wondering if there was a code to check the player's real time (based on the player's computer clock) to use to trigger certain events?
You can use time or datetime libraries for that. Here are some examples:
viewtopic.php?f=8&t=40687&p=430540#p430540
viewtopic.php?f=8&t=37939#p410599
viewtopic.php?f=51&t=47774
Although a player can cheat, changing the system time. You can try to avoid it by checking the internet time.
viewtopic.php?f=8&t=65745&p=556806&hili ... me#p556795
The second code made the most sense to me, I will test this out! Thank you for your help! ^^
PROJECTS:
Operation: Magic Hero [WiP]
Piece By Piece [COMPLETE][Spooktober VN '20]
RE/COUNT RE:VERSE [COMPLETE][RPG]
Since When Did I Have a Combat Butler?! [COMPLETE][NaNoRenO2020+]
Crystal Captor: Memory Chronicle Finale [COMPLETE][RPG][#1 in So Bad It's Good jam '17]

But dear God, You're the only North Star I would follow this far
Owl City "Galaxies"

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot]