Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

I have a bit of trouble with removing unnecessary music rooms from template. Using RenPy 8.5.0, I edit code and remove layout menu and links to layout menu from music rooms. However, I can only safely delete music room 2 or 3.

I plan to leave only music room 2, so I try to delete first and third music rooms and get an exception!


I'm sorry, but an uncaught exception occurred.

While running game code:

Exception: 'music_room' is not a screen or a label.

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

Traceback (most recent call last):

  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script

    python hide:

  File "renpy/ast.py", line 1187, in execute

    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/python.py", line 1273, 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 304, in interact

    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)

         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/display/core.py", line 2117, in interact

    repeat, rv = self.interact_core(

                 ~~~~~~~~~~~~~~~~~~^

        preloads=preloads,

        ^^^^^^^^^^^^^^^^^^

    ...<4 lines>...

        **kwargs,

        ^^^^^^^^^

    )

    ^

  File "renpy/display/core.py", line 3203, in interact_core

    rv = root_widget.event(ev, x, y, 0)

         ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^

  File "renpy/display/layout.py", line 1281, in event

    rv = i.event(ev, x - xo, y - yo, cst)

         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/display/layout.py", line 1281, in event

    rv = i.event(ev, x - xo, y - yo, cst)

         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/display/layout.py", line 1281, in event

    rv = i.event(ev, x - xo, y - yo, cst)

         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/display/screen.py", line 805, in event

    rv = self.child.event(ev, x, y, st)

         ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^

  File "renpy/display/layout.py", line 1281, in event

    rv = i.event(ev, x - xo, y - yo, cst)

         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/display/layout.py", line 1281, in event

    rv = i.event(ev, x - xo, y - yo, cst)

         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/display/behavior.py", line 1185, in event

    return handle_click(self.clicked)

           ~~~~~~~~~~~~^^^^^^^^^^^^^^

  File "renpy/display/behavior.py", line 1107, in handle_click

    rv = run(action)

         ~~~^^^^^^^^

  File "renpy/display/behavior.py", line 411, in run

    return action(*args, **kwargs)

           ~~~~~~^^^^^^^^^^^^^^^^^

  File "renpy/common/00action_menu.rpy", line 117, in __call__

    raise Exception("%r is not a screen or a label." % orig_screen)

Exception: 'music_room' is not a screen or a label.

Windows-10-10.0.19044-SP0 AMD64

Ren'Py 8.5.0.25111603

Tue Dec  9 16:05:45 2025

(+1)

Hey there! You probably still have a button or similar that's trying to go to screen music_room. You can search your code for it, or just rename the second music room screen to screen music_room if you want.

Thanks for quick answer and elegant simple solution, renaming room worked just fine!