Fixing Love Meter Bar [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
AngelSanctuary
Newbie
Posts: 12
Joined: Wed Oct 30, 2013 8:17 am
Projects: Catnip BB~
Location: Brazil
Contact:

Fixing Love Meter Bar [SOLVED]

#1 Post by AngelSanctuary »

Hii! ~

I'm using the code for a Love Meter Bar in my game, more precisely this code:
http://lemmasoft.renai.us/forums/viewto ... 51&t=22147

I've already made my modifications, like deleting the frame and the numbers that show how is going the affection. And what remained was only the bar.

So, what I'm trying to do is: Instead of the bar being displayed on the screen, I wanted to fix it in a status screen. If you want to see the bar you need to go to the status screen. And every time the affection increase or decrease, the difference keeps appearing on this screen.
But my bar isn't showing up on the status screen. :(

I don't understand about very elaborate codes, and don't know what I could use to make it work. If anyone has asked this before, sorry.
Last edited by AngelSanctuary on Mon Jul 14, 2014 7:47 pm, edited 1 time in total.

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

Re: Fixing Love Meter Bar

#2 Post by Alex »

So, what I'm trying to do is: Instead of the bar being displayed on the screen, I wanted to fix it in a status screen.
Well, if you'll show the code for your status screen and part of the code that made it appear onscreen then someone would definitely say what's going wrong.

User avatar
AngelSanctuary
Newbie
Posts: 12
Joined: Wed Oct 30, 2013 8:17 am
Projects: Catnip BB~
Location: Brazil
Contact:

Re: Fixing Love Meter Bar

#3 Post by AngelSanctuary »

Well, if you'll show the code for your status screen and part of the code that made it appear onscreen then someone would definitely say what's going wrong.
Sorry, I don't quite understand what you mean. ^^'
I really hope someone can understand this, and know how to use this code better than me. xD

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

Re: Fixing Love Meter Bar

#4 Post by Alex »

OokamiKasumi's code you've used for reference creates a single bar overlay. You've said you want a bar to be a part of a status screen. So, do you have a code for this status screen that don't work as you want it to? If so, please show it to let people check it.

User avatar
AngelSanctuary
Newbie
Posts: 12
Joined: Wed Oct 30, 2013 8:17 am
Projects: Catnip BB~
Location: Brazil
Contact:

Re: Fixing Love Meter Bar

#5 Post by AngelSanctuary »

This is my status screen. It's very simple.

Code: Select all

screen status:
    modal True
    tag menu
    add "images_for_renpy/status_screen.png"

    imagebutton auto "gui/game_menu_return_%s.png" xpos 49 ypos 730 focus_mask True action Hide("status") at nav_eff hover_sound "music/click.wav"
    
init -2:
    transform nav_eff:
        on idle:
            easein 0.5 xpos 49
        on selected_idle:
            easein 0.5 xpos 49
        on hover:
            easein 0.3 xpos 19
            easein 0.3 xpos 59
        on selected_hover:
            easein 0.3 xpos 19
            easein 0.3 xpos 59
And for the bar to appear, I'm using the

Code: Select all

$ show_character=True
    $ character_love+=50
on the label start start.

If I don't hide the $ show_character=True, the bar will constantly appear on the screen. That's what I wanted, but in the status screen instead, not on the start screen. I've tried puting this code on the status screen. The game doesn't have any errors, okay, but the bar doesn't appear either.

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

Re: Fixing Love Meter Bar

#6 Post by Alex »

Ok, overlay functions were the way to show stuff before screens were implemented. So, you really don't need the overlay part anymore (only styling part) - just add the bar right in your screen, like

Code: Select all

screen status:
    modal True
    tag menu
    add "images_for_renpy/status_screen.png"

    bar value character_love range max_love style "my_bar" xpos 49 ypos 130 

    imagebutton auto "gui/game_menu_return_%s.png" xpos 49 ypos 730 focus_mask True action Hide("status") at nav_eff hover_sound "music/click.wav"
http://www.renpy.org/doc/html/screens.html#bar

User avatar
AngelSanctuary
Newbie
Posts: 12
Joined: Wed Oct 30, 2013 8:17 am
Projects: Catnip BB~
Location: Brazil
Contact:

Re: Fixing Love Meter Bar

#7 Post by AngelSanctuary »

It worked! Thank you! :D

I've tested the bar in all the ways possible, and everything worked.
You solved my problem. ^^

Post Reply

Who is online

Users browsing this forum: No registered users