Custom menu - JumpOutException?

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
Mild Curry
Regular
Posts: 107
Joined: Fri Jul 02, 2010 3:03 pm
Projects: That's The Way The Cookie Crumbles
Organization: TwinTurtle Games
Contact:

Custom menu - JumpOutException?

#1 Post by Mild Curry »

I'm trying to create a custom menu with an imagemap, which looks like this:

Code: Select all

label main_menu:
    $ result = renpy.imagemap("title_screen.png", "title_screen2.png", [
        (475, 370, 704, 439, "enter"), (474, 444, 704, 506, "cheat"),(474, 511, 704, 572, "quit")
    
    if result == "enter":
        hide mainmenu
        $ renpy.jump_out_of_context("start")
    #and then the other options
But it keeps returning this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

JumpOutException: start

While running game code:
 - script call at line 753 of renpy-6.11.2/common/00library.rpy
 - script at line 84 of C:\Documents and Settings\Owner\My Documents\ren'py projects\Mr. Toko!/game/script.rpy
 - python at line 84 of C:\Documents and Settings\Owner\My Documents\ren'py projects\Mr. Toko!/game/script.rpy.

So, someone, please help. What am I doing wrong and how do I fix it?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Custom menu - JumpOutException?

#2 Post by PyTom »

It seems likely that you're not actually in a menu context. Could you have fallen through from the splashscreen to the main_menu, or something like that?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Mild Curry
Regular
Posts: 107
Joined: Fri Jul 02, 2010 3:03 pm
Projects: That's The Way The Cookie Crumbles
Organization: TwinTurtle Games
Contact:

Re: Custom menu - JumpOutException?

#3 Post by Mild Curry »

That...that is probably exactly it. I didn't know there was such a thing as a 'menu context' but, yeah, the splashscreen comes right before...

Looks like this:

Code: Select all

label splashscreen:
#splashscreen plays

label main_menu:
Er...how do I turn it into a real menu?

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

Re: Custom menu - JumpOutException?

#4 Post by Alex »

Looks like you forgot <return> statement at the end of your splashscreen.

Code: Select all

label splashscreen:
    #splashscreen plays
    return

label main_menu:

Mild Curry
Regular
Posts: 107
Joined: Fri Jul 02, 2010 3:03 pm
Projects: That's The Way The Cookie Crumbles
Organization: TwinTurtle Games
Contact:

Re: Custom menu - JumpOutException?

#5 Post by Mild Curry »

And that totally solves it. Wow.

Many, many thanks.

Post Reply

Who is online

Users browsing this forum: Kia, Majestic-12 [Bot]