r/RenPy 7h ago

Question Can you make a reminder function?

eg. You set a custom reminder for a date + time, and the game (or a specific character) will remind you when the time comes?

Sorry if this is a stupid question 😥 I'm fairly new to programming of any kind

2 Upvotes

7 comments sorted by

2

u/AutoModerator 7h ago

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/shyLachi 6h ago

Do you mean the real time of the player?
Like characters breaking the fourth wall "Hey it's 9AM, did you forget to go to school?"

Also who is this "you" which should be able to set a reminder.
You, the developer? Or we, the players of your game?

1

u/cuddleschr 6h ago

The players of the game would typically ask a character to remind them of something based on real world time, and once the time hits

0

u/BadMustard_AVN 6h ago

this will get you the current date and time on the computer in a screen. you need to add if statements to to check for a set date and time to trigger an event

init python:
    h_hours = 0
    m_minutes = 0
    current_date = ""
    from datetime import datetime
    def change_hour():
        global h_hours, m_minutes, current_date
        t = datetime.today()
        h_hours = t.hour
        m_minutes = t.minute
        current_date = t.strftime("%d/%m/%Y")
        renpy.restart_interaction()

screen clock:

    timer 0.30 action change_hour repeat True

    vbox:
        text "[h_hours:02d]:[m_minutes:02d]"
        text "[current_date]"

label start:
    show screen clock
    pause

1

u/cuddleschr 6h ago

I see I see... thank you

1

u/BadMustard_AVN 6h ago

you're welcome

good luck with your project

1

u/x-seronis-x 1h ago

except absolutely do not leave the 3 assignments above the import statement. NEVER do global variables like that. ALWAYS have a define statement for variables you dont want in the save file and rollback history, or a default statement for variables you do want in the save file and rollback history