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.
I didn't think this should be hard but I'm k=having trouble forcing and end of day event. I have a NewDay event which works file when the character selects 'sleep' but I want to also force it so that when the HOUR timer hits a certain number it forces a jump to the NewDay event.
Thanks to you both, I think my issues is where I have it... and apparently I'm not sure where it should be. I have a few rpy files - my main script with the events and dialogue options, a navigation script with my locations and where they go, and my stats file for all the variables items and relationships. In the last one, my stats, I start it off by defining things like the day and hour (which I then add to the screen call) and when I define hour I told it "if hour >= 24:"... but throughout the game between the locations and conversations I wanted the user to have more freedom in where they go so they could talk to whoever they want or do certain activities but each one would cost time and energy. If time got to 24 it would start a new day.
So where would it be best to add this? I can add it to the screen like you suggested but anyplace else?
This way if there are other stats that are not displayed but have 'countdowns' to them I'd know where to put them.
Thanks, I tried your code and it did work. Though one thing that I may have described incorrectly was that I wanted the timer to be more of a 'counter' - the player can do different actions, each adding 1 or two hours to the 'hour' variable. When 'hour' reaches or exceeds 24 the it forces the NewDay jump
Yours worked great except for me it was just adding the hours like a timer, but that said it DID work. Anything I can do to modify it to could the hours as they change vs just counting up?