Character Customization Menu Buttons Not Working [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
sasquatchii
Miko-Class Veteran
Posts: 552
Joined: Fri Jul 04, 2014 7:48 am
Completed: A Day in the Life of a Slice of Bread
Deviantart: sasquatchix
Soundcloud: sasquatchii
itch: sasquatchii
Location: South Carolina
Contact:

Character Customization Menu Buttons Not Working [SOLVED]

#1 Post by sasquatchii »

Hi, I am using Rinmaru's Messy Character Customization Tutorial from the Ren'Py Cookbook as a base to create my game.

I'm having a little trouble with the Character Customization screen, getting the rollovers and selected-idle buttons to work.

Here's a screenshot of what my game currently looks like:
Image

And this is what it's supposed to look like with rollovers:
Image

But whenever I go to select the characters in my game, nothing happens! There is no interactivity or response at all. I've uploaded my game to google drive if any kind soul might want to take a look at it: https://drive.google.com/open?id=0B8oQ7 ... XZEeXRlR0E

Here is the code that I am using in the cc_screen.rpy file:

Code: Select all

define character_img = "character"

screen character_customization_screen:
    zorder 1000
    modal True
    tag menu
    
    

    # The main menu buttons.
    
    imagemap:
        ground "gui/characterselect-idle.png"
        idle "gui/characterselect-hover.png"
        hover "gui/characterselect-hover.png"
        selected_idle "gui/characterselect-hover.png"      
        alpha False
        
        # This is so that everything transparent is invisible to the cursor.
        
                hotspot (63,98,55,62) action [ SetVariable( "characterclass", "Wildman")]
                hotspot (125,98,55,62) action [ SetVariable( "characterclass", "skeleton")]
                hotspot (187,98,55,62) action [ SetVariable( "characterclass", "dog")]
                hotspot (249,98,55,62) action [ SetVariable( "characterclass", "druid")]
                hotspot (311,98,55,62) action [ SetVariable( "characterclass", "wisewoman")]
                hotspot (373,98,55,62) action [ SetVariable( "characterclass", "pilot")]
                
                hotspot (63,181,55,62) action [ SetVariable( "characterclass", "islandman")]
                hotspot (125,181,55,62) action [ SetVariable( "characterclass", "islandwoman")]
                hotspot (187,181,55,62) action [ SetVariable( "characterclass", "archeologist")]  
                hotspot (249,181,55,62) action [ SetVariable( "characterclass", "girl")]
                hotspot (311,181,55,62) action [ SetVariable( "characterclass", "mechanic")]
                hotspot (373,181,55,62) action [ SetVariable( "characterclass", "nerd")]
              
                hotspot (382,246,98,36) action Return()

           
        
    add character_img:
Any help, ideas, or insight is always appreciated!
Last edited by sasquatchii on Wed Jun 28, 2017 7:12 am, edited 1 time in total.
ImageImage

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

Re: Character Customization Menu Rollover Buttons Not Workin

#2 Post by philat »

Code: Select all

screen character_customization_screen:
    zorder 1000 # this will make the screen show up in front of the dialogue you have asking "who are you, exactly?" Since you have modal True, this seems unnecessary. You may have to edit the images so that your bottom of the screen isn't obscured by the textbox though.
    modal True
    tag menu # why are you tagging this menu? Unless it's for something other than the tutorial
    
    

    # The main menu buttons.
    
    imagemap:
        ground "gui/characterselect-idle.png"
        idle "gui/characterselect-hover.png" # this should be idle.png, not hover.png
        hover "gui/characterselect-hover.png"
        selected_idle "gui/characterselect-hover.png"      
        alpha False
        
        # This is so that everything transparent is invisible to the cursor.

                # unindent this block -- it should be on the same level as the ground, idle, etc. statements
                hotspot (63,98,55,62) action [ SetVariable( "characterclass", "Wildman")]
                hotspot (125,98,55,62) action [ SetVariable( "characterclass", "skeleton")]
                hotspot (187,98,55,62) action [ SetVariable( "characterclass", "dog")]
                hotspot (249,98,55,62) action [ SetVariable( "characterclass", "druid")]
                hotspot (311,98,55,62) action [ SetVariable( "characterclass", "wisewoman")]
                hotspot (373,98,55,62) action [ SetVariable( "characterclass", "pilot")]
                
                hotspot (63,181,55,62) action [ SetVariable( "characterclass", "islandman")]
                hotspot (125,181,55,62) action [ SetVariable( "characterclass", "islandwoman")]
                hotspot (187,181,55,62) action [ SetVariable( "characterclass", "archeologist")]  
                hotspot (249,181,55,62) action [ SetVariable( "characterclass", "girl")]
                hotspot (311,181,55,62) action [ SetVariable( "characterclass", "mechanic")]
                hotspot (373,181,55,62) action [ SetVariable( "characterclass", "nerd")]
              
                hotspot (382,246,98,36) action Return()

User avatar
sasquatchii
Miko-Class Veteran
Posts: 552
Joined: Fri Jul 04, 2014 7:48 am
Completed: A Day in the Life of a Slice of Bread
Deviantart: sasquatchix
Soundcloud: sasquatchii
itch: sasquatchii
Location: South Carolina
Contact:

Re: Character Customization Menu Rollover Buttons Not Workin

#3 Post by sasquatchii »

Thank you so much, Philat! I made all of the changes you posted and now IT WORKS!! I think it was the indentation of the character class blocks that did me in - I fixed that first and then everything was magically working the way it was supposed to be.

Thank you again! You have saved me so much time and headache trying to figure out where I went wrong with my code :)
ImageImage

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Majestic-12 [Bot], Nozori_Games