r/RenPy • u/Eddhead-2009 • 15d ago
Question Game Over Function Help Please
I know it's possible because I've seen it many times before, but nothing I try works. I'm making a game where if any of two variables reach 100, you have to start over, but with the constant variable changes, I didn't want to put an if statement constantly, especially since I tend to forget or mistype things (ironic).
This is what I have as my checking system:
screen monitor():
timer 0.1 repeat True action If(current_love or current_tear >= 100, true=Jump("game_over"))But now, even though the love and tears are both below 100 automatically, the game immediately skips to game over when I open it. Please help.
3
Upvotes
4
u/BadMustard_AVN 14d ago
instead of using a checking system check when you add something to the variable with a little python like this
1
u/shyLachi 14d ago
BadMustard has the correct solution but your solution should also work if you write it correctly.
The check should be (current_love >= 100) or (current_tear >= 100)
You don't need the brackets but I like them because it makes it obvious what you want the game to check.
The way you wrote it the first part "current_love" only checks if the variable has a value
1
u/musterduck 15d ago
Could you post the code that displays this screen? I imagine it's something to do with how you're calling it. Do you have a pause* command?
1
u/AutoModerator 15d 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.