Sanity meter! [Solved]

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.
Post Reply
Message
Author
User avatar
Blue Mythic
Newbie
Posts: 11
Joined: Sat Oct 28, 2017 11:31 pm
Organization: Blue Mythic
Contact:

Sanity meter! [Solved]

#1 Post by Blue Mythic »

So I'd like to have a vertical meter showing on the side of the screen that is impacted by the users choices. Ie. if the user does something crazy, their meter would go down, and they would see it drain. The only trouble is I don't know where to begin with making a meter :( Does anybody know how to create a bar like that? Any help would be greatly appreciated!
Last edited by Blue Mythic on Mon Sep 30, 2019 9:13 pm, edited 1 time in total.

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Sanity meter!

#2 Post by Alex »

You need a variable to store sanity level, and then you could visualize it using a vertical bar.

Try

Code: Select all

screen my_vbar():
    vbar value my_sanity range max_sanity ysize 100 align (0.05, 0.05)

define max_sanity = 100
default my_sanity = max_sanity

label start:
    show screen my_vbar
    "..."
    $ my_sanity -= 30
    "I feel not so good..."
    "?!"

https://www.renpy.org/doc/html/screens.html
https://www.renpy.org/doc/html/screens.html#bar
https://www.renpy.org/doc/html/screens.html#vbar
https://www.renpy.org/doc/html/python.h ... -statement

User avatar
Blue Mythic
Newbie
Posts: 11
Joined: Sat Oct 28, 2017 11:31 pm
Organization: Blue Mythic
Contact:

Re: Sanity meter!

#3 Post by Blue Mythic »

I feel so silly for not getting that sooner, thanks a bunch!

Post Reply

Who is online

Users browsing this forum: snotwurm