Stupid "global name '_menu'" issue

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
moodykillmar
Newbie
Posts: 8
Joined: Sun Jun 11, 2017 12:27 pm
Contact:

Stupid "global name '_menu'" issue

#1 Post by moodykillmar »

I have seen the threads with the same problem, and I've looked through my script hundreds of times.

Code: Select all

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

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

Full traceback:
  File "C:\Users\APPLE\Desktop\renpy-6.99.12.4-sdk\renpy\bootstrap.py", line 295, in bootstrap
    renpy.main.main()
  File "C:\Users\APPLE\Desktop\renpy-6.99.12.4-sdk\renpy\main.py", line 430, in main
    renpy.game.script.report_duplicate_labels()
  File "C:\Users\APPLE\Desktop\renpy-6.99.12.4-sdk\renpy\script.py", line 890, in report_duplicate_labels
    if renpy.parser.report_parse_errors():
  File "C:\Users\APPLE\Desktop\renpy-6.99.12.4-sdk\renpy\parser.py", line 2543, in report_parse_errors
    renpy.display.error.report_parse_errors(full_text, error_fn)
  File "C:\Users\APPLE\Desktop\renpy-6.99.12.4-sdk\renpy\display\error.py", line 179, in report_parse_errors
    error_fn=error_fn,
  File "C:\Users\APPLE\Desktop\renpy-6.99.12.4-sdk\renpy\game.py", line 280, in invoke_in_new_context
    return callable(*args, **kwargs)
  File "C:\Users\APPLE\Desktop\renpy-6.99.12.4-sdk\renpy\display\error.py", line 43, in call_exception_screen
    return renpy.ui.interact(mouse="screen", type="screen", suppress_overlay=True, suppress_underlay=True)
  File "C:\Users\APPLE\Desktop\renpy-6.99.12.4-sdk\renpy\ui.py", line 285, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\APPLE\Desktop\renpy-6.99.12.4-sdk\renpy\display\core.py", line 2519, in interact
    i()
  File "renpy/common/00voice.rpy", line 360, in voice_interact
    if _menu:
NameError: global name '_menu' is not defined

Windows-8-6.2.9200
Ren'Py 6.99.12.4.2187
Root 1.0

Can someone look through my script? Maybe a second pair of eyes can find it.

Thanks.
Attachments
script.rpy
(26.79 KiB) Downloaded 141 times

User avatar
papiersam
Veteran
Posts: 231
Joined: Fri Aug 12, 2016 2:24 pm
Completed: Gem Hunt Beta, 1/Probably, Animunch
Projects: The Panda Who Dreamed
Contact:

Re: Stupid "global name '_menu'" issue

#2 Post by papiersam »

It doesn't quite mean it's not actually there--my bad assumption is that it never reaches that script to load the name.

It's usually caused by a duplicate in one or any of your scripts, or even incorrect indentation.

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

Re: Stupid "global name '_menu'" issue

#3 Post by Imperf3kt »

After a quick look, I see no immediate issues, but as noted above, it is not necessarily a duplicate label. Incorrect indentation in other .rpy files can also cause this issue.
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

moodykillmar
Newbie
Posts: 8
Joined: Sun Jun 11, 2017 12:27 pm
Contact:

Re: Stupid "global name '_menu'" issue

#4 Post by moodykillmar »

I ended up creating a new ren'py file copying the same code to it, and it works fine. That is rather annoying :? LOL oh well!

Saiffyros
Newbie
Posts: 14
Joined: Sun May 21, 2017 10:13 pm
Contact:

Re: Stupid "global name '_menu'" issue

#5 Post by Saiffyros »

You get that mistake when you have two labels with the same name.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], alyoshaslab