Blank main menu

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
OverHeatingMyMind
Newbie
Posts: 13
Joined: Sun Mar 04, 2012 9:33 am
Completed: Cardiff_Insane Letters (NaNo 2014), CLOSED / NEEDS
Projects: Système Isolé
Organization: Endless Seasons
Tumblr: endlessseasons
Contact:

Blank main menu

#1 Post by OverHeatingMyMind » Sat Jun 14, 2014 9:53 am

Hello everyone! I began coding the main menu of one of my games with imagemap like I usually do and everything should technically be fine but as soon as I launch the game I just get... a blank screen. There's no error message or anything. Just a blank screen with nothing on it. Could you guys help me with that?

Here's the code of the menu since I strongly suspect there's a problem there:

Code: Select all

screen main_menu:

      tag menu
        
             add "interface/title.jpg"
         
             imagemap:
             
             ground "interface/mm_ground.png"
             idle "interface/mm_idle.png"
             hover "interface/mm_hover.png"
        
    
             hotspot (924,430,230,52) action Start()
             hotspot (948,494,221,43) action ShowMenu("load")
             hotspot (966,549,224,43) action ShowMenu("preferences")
             hotspot (986,604,222,44) action Quit(confirm=False)
             hotspot (1006,660,222,44) action Web ()
        
              if persistent.beaten:
            
               hotspot (756,604,222,44) action ShowMenu("bonus")

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Blank main menu

#2 Post by Asceai » Sat Jun 14, 2014 10:12 am

You need to be careful about indentation. It's vitally important in Python and Ren'Py.

Here's a version of your code with the indentation (and only the indentation) fixed:

Code: Select all

screen main_menu:

    tag menu

    add "interface/title.jpg"

    imagemap:

        ground "interface/mm_ground.png"
        idle "interface/mm_idle.png"
        hover "interface/mm_hover.png"


        hotspot (924,430,230,52) action Start()
        hotspot (948,494,221,43) action ShowMenu("load")
        hotspot (966,549,224,43) action ShowMenu("preferences")
        hotspot (986,604,222,44) action Quit(confirm=False)
        hotspot (1006,660,222,44) action Web ()

        if persistent.beaten:

            hotspot (756,604,222,44) action ShowMenu("bonus")
After fixing the indentation, two problems remain:

Code: Select all

        hotspot (1006,660,222,44) action Web ()
Web() is not a predefined Action. If this is an Action you created, that's all well and good, but otherwise you'll get an error.

Code: Select all

        if persistent.beaten:

            hotspot (756,604,222,44) action ShowMenu("bonus")
You don't want to do this. Imagemaps expect the hotspots to always be the same because they cache the hotspots. This is the way to do it:

Code: Select all

        hotspot (756,604,222,44) action If(persistent.beaten, ShowMenu("bonus"))

User avatar
OverHeatingMyMind
Newbie
Posts: 13
Joined: Sun Mar 04, 2012 9:33 am
Completed: Cardiff_Insane Letters (NaNo 2014), CLOSED / NEEDS
Projects: Système Isolé
Organization: Endless Seasons
Tumblr: endlessseasons
Contact:

Re: Blank main menu

#3 Post by OverHeatingMyMind » Sat Jun 14, 2014 1:28 pm

Thanks a lot! Everything's working perfectly now :)

Post Reply

Who is online

Users browsing this forum: No registered users