Hi!
I want Ren'Py to check the date of the computer so I can add holiday events. Where player's would get special event items, outfits, and special characters. I don't know if it's possible, but it'd be a great help! Thanks a bunch!
How can I have it so Ren'Py checks the date of the computer?
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.
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.
-
- Newbie
- Posts: 3
- Joined: Sat Feb 20, 2021 10:45 pm
- Projects: I'm work on a indie game, it has no name yet, but it's a husband/wife collection game. It has some rpg elements to.
- Deviantart: EnderSprings
- Discord: 🌸🌺EnderSprings 🌺🌸#7320
- Contact:
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: How can I have it so Ren'Py checks the date of the computer?
Use the datetime module:
Code: Select all
init python:
import datetime
label start:
$ now = datetime.datetime.now()
if now.month == 1 and now.day == 1:
"Happy new year."
else:
"Happy not-new-year."
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Newbie
- Posts: 3
- Joined: Sat Feb 20, 2021 10:45 pm
- Projects: I'm work on a indie game, it has no name yet, but it's a husband/wife collection game. It has some rpg elements to.
- Deviantart: EnderSprings
- Discord: 🌸🌺EnderSprings 🌺🌸#7320
- Contact:
Re: How can I have it so Ren'Py checks the date of the computer?
Thank you a bunch! is there anywhere I could find the module?
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: How can I have it so Ren'Py checks the date of the computer?
The datetime module is built into Ren'Py. You can find the documentation at:
https://docs.python.org/2/library/datetime.html
https://docs.python.org/2/library/datetime.html
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Newbie
- Posts: 3
- Joined: Sat Feb 20, 2021 10:45 pm
- Projects: I'm work on a indie game, it has no name yet, but it's a husband/wife collection game. It has some rpg elements to.
- Deviantart: EnderSprings
- Discord: 🌸🌺EnderSprings 🌺🌸#7320
- Contact:
Re: How can I have it so Ren'Py checks the date of the computer?
Oh, thank you a bunch! That was a bunch of help!
Who is online
Users browsing this forum: No registered users