Help with uncaught exception: '_menu' is not defined

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
willanik
Regular
Posts: 35
Joined: Fri Mar 24, 2017 7:44 pm
Contact:

Help with uncaught exception: '_menu' is not defined

#1 Post by willanik »

Oh dear, for the first time I have an “uncaught exception” whatever that is. I have been setting up a game and without warning this message came up:

I'm sorry, but an uncaught exception occurred.

After initialization, but before game start.
File "renpy/common/00voice.rpy", line 360, in voice_interact
if _menu:
NameError: global name '_menu' is not defined


I have no idea what to do! I have a backup file but I will lose six hours of work so I’d prefer to fix this exception if I can! Very grateful for any advice people can give me.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Help with uncaught exception: '_menu' is not defined

#2 Post by Imperf3kt »

An "uncaught exception" means Ren'Py didn't catch/detect it before trying to run/build the game and failed after trying to start your game.


This particular error is usually caused by duplicate label names or using a variable that shares its name with a label.
I'd suggest double-checking your label names are all unique.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Help with uncaught exception: '_menu' is not defined

#3 Post by Remix »

Though it might not be the issue here, I recall this or a similar error occurring when a label or named menu is defined twice.

Perhaps, just in case, look through your code and just check you do not have duplicate label / menu names.

Other than that, what were you actually changing in your code before getting the error?
Frameworks & Scriptlets:

willanik
Regular
Posts: 35
Joined: Fri Mar 24, 2017 7:44 pm
Contact:

Re: Help with uncaught exception: '_menu' is not defined

#4 Post by willanik »

Thanks, I managed to fix it and save all my work :)

I could not find anything that I considered an exact duplication in the new label that caused the crash, but I reworked it until it behaved itself.

I appreciate your advice!

Post Reply

Who is online

Users browsing this forum: Andredron