Menu not working? (SOLVED)

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
lacticacid
Regular
Posts: 36
Joined: Fri Nov 23, 2018 6:44 pm
Contact:

Menu not working? (SOLVED)

#1 Post by lacticacid » Fri Mar 29, 2019 5:22 am

Hi. I made a custom menu for a game I'm working on. (I separated the navigation and main menu screens):

Code: Select all

screen main_menu():

    tag menu

    style_prefix "main_menu"

    add gui.main_menu_background

    frame:
        pass
    add Image("gui/logo.png") zoom 0.65
    add renpy.random.choice(['images/candace_neutral.png', 'images/candace_openmouth.png']) xalign 3.0 yalign 0.15 zoom 0.55 at dissolve

    vbox:
        style_prefix "navigation"

        xalign 0.5
        yalign 0.85

        spacing 10

        imagebutton:
            idle "gui/menu_button1.png" at menubutton
            hover "gui/menu_button.png"
            action Start()

        imagebutton:
            idle "gui/menu_button1.png" at menubutton
            hover "gui/menu_button.png"
            action ShowMenu("load")

        imagebutton:
            idle "gui/menu_button1.png" at menubutton
            hover "gui/menu_button.png"
            action ShowMenu("preferences")

        imagebutton:
            idle "gui/menu_button1.png" at menubutton
            hover "gui/menu_button.png"
            action ShowMenu("about")

        imagebutton:
            idle "gui/menu_button1.png" at menubutton
            hover "gui/menu_button.png"
            action Quit()
    vbox:
        style_prefix "navigation"

        xalign 0.5
        yalign 0.848

        spacing 23

        add Text("New Game", slow=15, size=27, xalign=0.5, font="Katscript.ttf")
        add Text("Load Game", slow=15, size=27, xalign=0.5, font="Katscript.ttf")
        add Text("Options", slow=15, size=27, xalign=0.5, font="Katscript.ttf")
        add Text("Credits", slow=15, size=27, xalign=0.5, font="Katscript.ttf")
        add Text("Quit", slow=15, size=27, xalign=0.5, font="Katscript.ttf")
And it gives me this error whenever I try to press a button:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
Exception: Parameter 'new_widget' is not known by ATL Transform.

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

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "C:\Users\NerdyMaxx\Downloads\renpy-7.1.1-sdk\renpy\ast.py", line 896, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\NerdyMaxx\Downloads\renpy-7.1.1-sdk\renpy\python.py", line 1929, in py_exec_bytecode
    exec bytecode in 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 "C:\Users\NerdyMaxx\Downloads\renpy-7.1.1-sdk\renpy\ui.py", line 289, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\NerdyMaxx\Downloads\renpy-7.1.1-sdk\renpy\display\core.py", line 2690, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\NerdyMaxx\Downloads\renpy-7.1.1-sdk\renpy\display\core.py", line 3027, in interact_core
    new_widget=layers_root)
  File "C:\Users\NerdyMaxx\Downloads\renpy-7.1.1-sdk\renpy\atl.py", line 436, in __call__
    raise Exception('Parameter %r is not known by ATL Transform.' % k)
Exception: Parameter 'new_widget' is not known by ATL Transform.

Windows-8-6.2.9200
Ren'Py 7.2.1.457
penis and fern 1.0
Fri Mar 29 05:14:34 2019
The New game button is the only button that's working.
I tried putting the main menu screen under the navigation screen using an if main_menu statement, but it still gives me the same exact error. What do I do?

UPDATE: I replaced ShowMenu() with Show() and it's working now.
UPDATE: I'm an idiot. I named a transform dissolve.
Last edited by lacticacid on Sun Apr 07, 2019 1:40 pm, edited 1 time in total.
~There is almost always a better, easier way to approach a problem.~

User avatar
Alex
Lemma-Class Veteran
Posts: 2429
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Menu not working? (SOLVED)

#2 Post by Alex » Fri Mar 29, 2019 6:24 am

lacticacid wrote:
Fri Mar 29, 2019 5:22 am
...
Check this line

Code: Select all

add renpy.random.choice(['images/candace_neutral.png', 'images/candace_openmouth.png']) xalign 3.0 yalign 0.15 zoom 0.55 at dissolve
"At" expects ATL transform to apply to displayable not a transition.

https://www.renpy.org/doc/html/transforms.html
https://www.renpy.org/doc/html/transitions.html

Post Reply

Who is online

Users browsing this forum: Adrian_DVL, Google [Bot], Nighten