Party Screen with buttons... [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
Nekomimi
Newbie
Posts: 4
Joined: Sun Nov 18, 2012 6:31 pm
Contact:

Party Screen with buttons... [SOLVED]

#1 Post by Nekomimi »

Hi, I'm kind of a newbie to Ren'Py, so please bear with me OTL

So I'm making a game where there is a party screen in which people can check on the stats of their current members. I wanted to have it so that you can see different versions of the characters depending on their status (greyscale if they're dead, a lock if they haven't been met yet, etc.). So far it works... Kinda. Right now only one button seems to work at a time. I've implemented both Sheehan & Audrey (characters) and I'm only able to see one button at a time. Hopefully someone can help me out? OTL

Code: Select all

screen party():
    
    tag menu
    
    imagemap:
        ground "ground.png"
        
        if stataudrey == "Alive":
            idle "audreyicon1.png"
            hover "audreyicon3.png"
            hotspot (33, 36, 207, 202) clicked ShowMenu('audrey')
        elif stataudrey == "Dead":
            image "audreyicon2.png"
        
        if statsheehan == "Alive" and sparty == 1:
            idle "sheehanicon1.png"
            hover "sheehanicon3.png"
            hotspot (298, 271, 218, 253) clicked ShowMenu('sheehan')
        elif statsheehan == "Dead":
            image "sheehanicon2.png"
              
        if statkyu == "Alive" and kparty == 1:
            hotspot (551, 30, 222, 233) clicked ShowMenu('kyu')
            idle "kyuicon1.png"
        elif statkyu == "Dead":
            image "kyuicon2.png"
        
        if stathayley == "Alive" and hparty == 1:
            hotspot (300, 38, 205, 205) clicked ShowMenu('hayley')
            idle "hayleyicon1.png"
        elif stathayley == "Dead":
            image "hayleyicon2.png"
    
        if statdylan == "Alive" and dparty == 1:
            hotspot (12, 290, 236, 238) clicked ShowMenu('dylan')
            idle "dylanicon1.png"
        elif statdylan == "Dead":
            image "dylanicon2.png"
    
        if statkait == "Alive" and kkparty == 1:
            hotspot (560, 323, 203, 205) clicked ShowMenu('kait')
            idle "kaiticon1.png"
        elif statkait == "Dead":
            image "kaiticon2.png"
            
        image "partyscreen.png"
        
    hbox:
        xalign 1.0 
        yalign 1.0
        textbutton("Back") action Return()
Thanks for your time ////
Last edited by Nekomimi on Sat Apr 16, 2016 12:27 am, edited 1 time in total.

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Party Screen with buttons changing depending on availabi

#2 Post by philat »

Use image buttons, not image map. You also do not want to be doing this with simple variables.

Imagebutton tutorial: viewtopic.php?f=51&t=22565
Tutorial on OOP: http://inventwithpython.com/blog/2014/1 ... e-example/

Nekomimi
Newbie
Posts: 4
Joined: Sun Nov 18, 2012 6:31 pm
Contact:

Re: Party Screen with buttons changing depending on availabi

#3 Post by Nekomimi »

woah thank you so much! I messed around with it and it's working c:

Post Reply

Who is online

Users browsing this forum: Google [Bot]