Hi people,
I have just added content to a game I am working on. The game has behaved well until today when I hit load. Rather than it starting the game, I got the following message:
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:\home\game version 211119\renpy-6.99.12.3-sdk\renpy\bootstrap.py", line 295, in bootstrap
renpy.main.main()
File "C:\home\game version 211119\renpy-6.99.12.3-sdk\renpy\main.py", line 430, in main
renpy.game.script.report_duplicate_labels()
File "C:\home\game version 211119\renpy-6.99.12.3-sdk\renpy\script.py", line 890, in report_duplicate_labels
if renpy.parser.report_parse_errors():
File "C:\home\game version 211119\renpy-6.99.12.3-sdk\renpy\parser.py", line 2543, in report_parse_errors
renpy.display.error.report_parse_errors(full_text, error_fn)
File "C:\home\game version 211119\renpy-6.99.12.3-sdk\renpy\display\error.py", line 179, in report_parse_errors
error_fn=error_fn,
File "C:\home\game version 211119\renpy-6.99.12.3-sdk\renpy\game.py", line 280, in invoke_in_new_context
return callable(*args, **kwargs)
File "C:\home\game version 211119\renpy-6.99.12.3-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:\home\game version 211119\renpy-6.99.12.3-sdk\renpy\ui.py", line 285, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\home\game version 211119\renpy-6.99.12.3-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-7-6.1.7601-SP1
Ren'Py 6.99.12.4.2187
New game II 0.10
I rebooted and the same thing happened. I have no idea what else to do to fix this! I am not using the latest version of Ren’py but this has not caused me any difficulties before.
I would be very grateful for any advice that more experienced developers can can give me.
Try to load game but get "uncaught exception"
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.
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.
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: Try to load game but get "uncaught exception"
willanik wrote: ↑Tue Nov 26, 2019 8:03 pm Hi people,
I have just added content to a game I am working on. The game has behaved well until today when I hit load. Rather than it starting the game, I got the following message:
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
-----
So it would seem something you have added triggers an exception, and it seems like it is the use of the variable _menu without having it defined.
Can you find the variable _menu in your code?
If not,
do you know what part of your code that has been added after the last time the game worked. If you add # in front of those lines, does the game work now?
- Donmai
- Eileen-Class Veteran
- Posts: 1960
- Joined: Sun Jun 10, 2012 1:45 am
- Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
- Projects: Slumberland
- Location: Brazil
- Contact:
Re: Try to load game but get "uncaught exception"
A common cause to this error is having duplicate labels in your script (two or more labels with the same name) or two copies of the same script in your game folder. Indentation errors can also trigger that error.
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)
TOIRE NO HANAKO (A Story About Fear)
Re: Try to load game but get "uncaught exception"
Thanks very much for the suggestions:
• I have worked through my text for misplaced indents and label duplications and have not found any yet (although I did find a couple of other errors that I’d previously missed!)
• I looked for _menu, but I cannot find it and it is not something I use.
• Good idea to add # to the new lines but unfortunately there are a couple thousand, so this might be my avenue of last resort! Maybe I could cut it all out, then if the game works I could selectively reintroduce it until I get the problem again?
I wish I could make more sense out of the traceback advice but it refers to actions and places that I simply cannot find. Grateful for any other ideas the people have.
• I have worked through my text for misplaced indents and label duplications and have not found any yet (although I did find a couple of other errors that I’d previously missed!)
• I looked for _menu, but I cannot find it and it is not something I use.
• Good idea to add # to the new lines but unfortunately there are a couple thousand, so this might be my avenue of last resort! Maybe I could cut it all out, then if the game works I could selectively reintroduce it until I get the problem again?
I wish I could make more sense out of the traceback advice but it refers to actions and places that I simply cannot find. Grateful for any other ideas the people have.
- 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: Try to load game but get "uncaught exception"
Did you upgrade Ren'Py recently?
I would suggest doing a Create New Project and piece-by-piece adding files into it until you find one that doesn't work... basically, from a clean (working) project, add files until it breaks as a way of tracking down the culprit...
I would suggest doing a Create New Project and piece-by-piece adding files into it until you find one that doesn't work... basically, from a clean (working) project, add files until it breaks as a way of tracking down the culprit...
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
- Donmai
- Eileen-Class Veteran
- Posts: 1960
- Joined: Sun Jun 10, 2012 1:45 am
- Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
- Projects: Slumberland
- Location: Brazil
- Contact:
Re: Try to load game but get "uncaught exception"
Normally, you won't find the _menu label in your scripts because that's a Ren'Py internal reserved name. We cannot use names starting with 00 or a single underscore, because they're reserved names. BTW check that you haven't used reserved names for any label or variable you may have created.
https://www.renpy.org/doc/html/reserved ... rved-names
If I recall it correctly, the line number refers to where the script execution stopped, not exactly where the error is located.File "C:\home\game version 211119\renpy-6.99.12.3-sdk\renpy\main.py", line 430, in main
renpy.game.script.report_duplicate_labels()
https://www.renpy.org/doc/html/reserved ... rved-names
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)
TOIRE NO HANAKO (A Story About Fear)
Re: [SOLVED] Try to load game but get "uncaught exception"
Thanks for all the good ideas.
I reloaded my backup (aren’t they great when you need them!) and then progressively fed in the new lines.
That way I found the problem, in some lines I had copied from an earlier part of the game. In the earlier part when I wrote:
call mysteryscene
the implementation of the game turned the line into:
call mysteryscene from _call_mysteryscene_1
When I copied this whole line into the new text, the game saw the reference to _call_mysteryscene_1 as a duplication and that caused the exception. I deleted _call_mysteryscene_1 from the new line and the game now works again.
Thanks guys!
I reloaded my backup (aren’t they great when you need them!) and then progressively fed in the new lines.
That way I found the problem, in some lines I had copied from an earlier part of the game. In the earlier part when I wrote:
call mysteryscene
the implementation of the game turned the line into:
call mysteryscene from _call_mysteryscene_1
When I copied this whole line into the new text, the game saw the reference to _call_mysteryscene_1 as a duplication and that caused the exception. I deleted _call_mysteryscene_1 from the new line and the game now works again.
Thanks guys!
- Donmai
- Eileen-Class Veteran
- Posts: 1960
- Joined: Sun Jun 10, 2012 1:45 am
- Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
- Projects: Slumberland
- Location: Brazil
- Contact:
Re: Try to load game but get "uncaught exception"
Glad to know it's working now.
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)
TOIRE NO HANAKO (A Story About Fear)
Who is online
Users browsing this forum: No registered users