Page 1 of 1

Error: "JumpOutException" [Solved(?)]

Posted: Mon Jun 29, 2015 7:09 pm
by Celestial_Toast
I have a bonus section in my game and it has buttons to the Gallery and Credits. Then the "Return" buttons on these pages link back to the bonus page.

It works the first time, and then throws an error next time and immediately closes the game.

the code for the Return buttons is:
textbutton "Return" action Start("bonus")

The code under my bonus label:
label bonus:
scene bg outsideMorning
menu:
"Gallery":
call screen cg_gallery
"Credits":
call screen credits
"Return":
call screen main_menu
return

Here's the full traceback:

I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 5352, in script
call screen credits
File "renpy/common/000statements.rpy", line 457, in execute_call_screen
store._return = renpy.call_screen(name, *args, **kwargs)
File "renpy/common/00action_menu.rpy", line 128, in __call__
renpy.jump_out_of_context(self.label)
JumpOutException: bonus

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\bootstrap.py", line 289, in bootstrap
renpy.main.main()
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\main.py", line 357, in main
run(restart)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\main.py", line 77, in run
renpy.execution.run_context(True)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\execution.py", line 598, in run_context
context.run()
File "game/script.rpy", line 5352, in script
call screen credits
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\ast.py", line 1635, in execute
self.call("execute")
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\ast.py", line 1653, in call
renpy.statements.call(method, parsed, *args, **kwargs)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\statements.py", line 144, in call
return method(parsed, *args, **kwargs)
File "renpy/common/000statements.rpy", line 457, in execute_call_screen
store._return = renpy.call_screen(name, *args, **kwargs)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\exports.py", line 2311, in call_screen
rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\ui.py", line 247, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\display\core.py", line 2149, in interact
repeat, rv = self.interact_core(preloads=preloads, **kwargs)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\display\core.py", line 2750, in interact_core
rv = root_widget.event(ev, x, y, 0)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\display\layout.py", line 846, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\display\layout.py", line 846, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\display\layout.py", line 846, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\display\screen.py", line 626, in event
rv = self.child.event(ev, x, y, st)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\display\layout.py", line 846, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\display\behavior.py", line 762, in event
return handle_click(self.clicked)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\display\behavior.py", line 705, in handle_click
rv = run(action)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\display\behavior.py", line 274, in run
return var(*args, **kwargs)
File "renpy/common/00action_menu.rpy", line 128, in __call__
renpy.jump_out_of_context(self.label)
File "C:\Users\Opal\Downloads\renpy-6.18.3-sdk\renpy\exports.py", line 1416, in jump_out_of_context
raise renpy.game.JumpOutException(label)
JumpOutException: bonus

Windows-post2008Server-6.2.9200
Ren'Py 6.18.3.761
CircusofSoaringDreams 0.0

Thanks in advance! Hopefully I can fix this before the deadline tomorrow D:

Re: Error: "JumpOutException"

Posted: Mon Jun 29, 2015 7:22 pm
by PyTom
The problem is you're not supposed to do "call screen main_menu". It doesn't actually return to the main menu context, just displays the screen. Try changing your code to read:

Code: Select all

label bonus:
    scene bg outsideMorning
    
    menu:
        "Gallery":
            call screen cg_gallery
        "Credits":
            call screen credits
        "Return":
            pass
    return
And you'll return to the main menu after the choice has finished.

Re: Error: "JumpOutException"

Posted: Mon Jun 29, 2015 7:39 pm
by Celestial_Toast
It's still giving me the same error. (Oh, and it's the return buttons on the Credits and Gallery pages giving me errors, the ones that link to the label bonus, not the return option in Bonus).

Also, now that I changed that, the return button on the bonus menu doesn't take me to the main menu, but instead to the beginning of the game. Strangely, it was working fine when I had it as "call main_menu"

Re: Error: "JumpOutException"

Posted: Mon Jun 29, 2015 7:56 pm
by PyTom
How are you calling bonus. I think it should be Start("bonus") and not Jump("bonus").

Re: Error: "JumpOutException"

Posted: Mon Jun 29, 2015 8:01 pm
by Celestial_Toast
It is Start(bonus). Also, it works fine the first time I do it, but only the first.

Re: Error: "JumpOutException"

Posted: Mon Jun 29, 2015 8:16 pm
by philat
Start() should be used when calling the bonus label from the main menu. From the gallery/credit screens, it should just be Return().

Re: Error: "JumpOutException"

Posted: Mon Jun 29, 2015 8:30 pm
by PyTom
Can you post all of the relevant code? The main menu, bonus menu, gallery and so on? It's really hard to support when we have to guess what's going on.

Re: Error: "JumpOutException"

Posted: Mon Jun 29, 2015 8:44 pm
by Celestial_Toast
I actually got around the problem by making bonus a screen instead of a label, and changing the code to match that. Now it works fine. Thanks for your help though! :)