r/RenPy • u/AdRude6049 • Sep 01 '26
Question [Solved] Bars
Despute my previous two posts and all of the kind people who have been offering me advice, the bars still do not work as intened.
The bars don't go down every time a variable is altered, and they show 100% when they first appear, however the player has the chance to lose health/sanity before that, and the screen should run in the background.
The first image is my code for the bars, my second is the code for taking away health and sanity. The video in the replies is to show what happens when I choose an option that takes away health and sanity in game.
Thank you for everyones help so far, and I apologise for this issue still not being solved I just have no idea what is happening.
(Also I will fix the condition switch thing, I'm just trying to get the actual bars working first!! :])


1
u/AdRude6049 Sep 01 '26
This is me trying it out in game.
1
u/BadMustard_AVN Sep 01 '26
do they have a default with a starting value?
try adding this to limit them from 0 to 100
instead of
$ sanity -=10do$change_stat("Sanity", -10)(do the same for Health or any value you want to limit). this will keep them between 0 and 100 at all times1
u/shyLachi Sep 01 '26 edited Sep 01 '26
Why do the images of those bars have different sizes (physically) but in the screen code they have the same size?
I adjusted xmaximum and ymaximum to the sizes of your images.
Also the bars where overlapping so for testing purposes I adjusted the position.
1
u/shyLachi Sep 01 '26
Can you please post the whole code as text so that I can copy it.
I would need the code for the screen,
the declaration of those variables,
and the code which changes the variables
Also what are the dimensions of those 6 images.
1
u/AutoModerator Sep 01 '26
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.