Gamepad crash issue and global name 'name' not Defined issues in 7.4.3

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
User avatar
RunaLiore
Newbie
Posts: 5
Joined: Mon Jul 18, 2022 11:09 am
Completed: 77 Oleander Ghost House Investigation, And Oath In Kind
itch: runa-liore
Contact:

Gamepad crash issue and global name 'name' not Defined issues in 7.4.3

#1 Post by RunaLiore » Mon Jul 18, 2022 8:37 pm

Despite being a crash this is a minor issue, since it seems fixed in both older and newer version of Renpy. Mostly I just want to understand the mechanisms of renpy better and understand what causes errors like this.

As stated in the subject, I've come across an issue that I thought was part of something broken in my own game's code but which turns out to happen in all renpy games I run from Renpy version 7.4.3.1414.

There are two parts to this issue.
First, when a gamepad is plugged in and any input is used from the gamepad at all, the game immediately crashes.
Second, when a gamepad is plugged in even just left to sit out on the desk untouched and no inputs are given, the game will occasionally experience a hiccup that causes a NameError: global name 'name' not defined. I'll use the traceback from The Question as an example below.

The good news is, this doesn't seem to happen in other versions of Renpy so I can get around it very easily (tested and confirmed this doesn't happen in 7.3.5 or 7.5.1) but even after finding this error dozens of times I can't figure out why it happens.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00start.rpy", line 274, in script
    python:
  File "renpy/common/00start.rpy", line 274, in script
    python:
  File "renpy/common/00start.rpy", line 278, in <module>
    renpy.call_in_new_context("_main_menu")
NameError: global name 'name' is not defined

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

Full traceback:
  File "renpy/bootstrap.py", line 326, in bootstrap
    renpy.main.main()
  File "renpy/main.py", line 617, in main
    run(restart)
  File "renpy/main.py", line 148, in run
    renpy.execution.run_context(True)
  File "renpy/execution.py", line 922, in run_context
    context.run()
  File "renpy/common/00start.rpy", line 274, in script
    python:
  File "renpy/common/00start.rpy", line 274, in script
    python:
  File "renpy/ast.py", line 922, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "renpy/python.py", line 2218, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "renpy/common/00start.rpy", line 278, in <module>
    renpy.call_in_new_context("_main_menu")
  File "renpy/game.py", line 344, in call_in_new_context
    return renpy.execution.run_context(False)
  File "renpy/execution.py", line 922, in run_context
    context.run()
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "renpy/ast.py", line 922, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "renpy/python.py", line 2218, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>
    python hide:
  File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide
    ui.interact()
  File "renpy/ui.py", line 298, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "renpy/display/core.py", line 3101, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
  File "renpy/display/core.py", line 3897, in interact_core
    renpy.display.behavior.skipping(ev)
  File "renpy/display/behavior.py", line 272, in skipping
    if map_keyup(ev, "skip") or map_event(ev, "stop_skipping"):
  File "renpy/display/behavior.py", line 242, in map_keyup
    if (name in ev.eventnames) and ev.up:
NameError: global name 'name' is not defined

Windows-10-10.0.19041
Ren'Py 7.4.3.1414
The Question Ren'Py 7 Edition
Mon Jul 18 20:01:11 2022
I've got a half dozen other examples of this error in very similar form tested across multiple games - whenever games are launched in, or had build distributions made in, 7.4.3 it seems that this error crops up. As I said before, the issue is fixed but I want to understand why it happens in case something similar ever comes up again.
And, every once in a while, remember this merry, cheerful, attractive paragon of a woman, and chant my name in praise three times every day.

Post Reply

Who is online

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