Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Hi, thanks so much for creating such a great expansion. 

Unfortunatly I ran into a few issues. When using the ESC key on keyboard, or the little menu button on my ps5 controller a bug appears that it hadn't before.  "An exception has occured. While running game code: File "renpy/common/00gamemenu.rpy" line 174 in script $ui.interact() TypeError: missing a required argument 'title'" 

This immediatly pops up if one of those buttons is pressed, and while I didn't check the controller without the expansion, I remember the ESC worked normally before . 

Then, whenever I mess up code (which is a lot lol), instead of renpy showing me where I messed up, everything is closed down and this is shown in my code editor: "I'm sorry, an uncaught exception has occured. After loading the script. File "game/backend/backend/controller_support/controller_override.rpy", line 196, in my_controller_event    NameError: name 'CONTROLLERDEVICEADDED' is not defined" Not sure if that's normal? 

And then I have a question regarding putting a controller_viewport   in the game menu screen. It seems like when I replace the normal viewport with the controller one there *is* a functioning scrollbar in all the game menus,... however you can't visually see it. I narrowed down the deciding component being "side_yfill True", without it even the normal viewport won't show the scrollbar, however controller viewport doesn't seem to support that property, and normal yfill True does nothing. 

Oops, I realize this was a whole wall of text, but I hope you can still help me out. Thank you so much in advance.

No worries! This is something I'm looking to update the files to make it a bit easier to understand - by default, the controller pack sets the game_menu screen to be opened when you hit the game_menu shortcut button (e.g. Start/ESC/right click). In the template, this is made possible by setting `title` as a keyword argument rather than a required argument, hence the error complaining about requiring the title argument.

You can remove or adjust this line `_game_menu_screen = "game_menu"` and/or adjust `screen game_menu` to have `title=""` instead of just `title` as an argument.

As for the error, you can put this into the my_controller_event function:

try:
    cda = CONTROLLERDEVICEADDED
except NameError:
    ## Probably reporting some other error
    return rv

put it just above the `if ev.type == CONTROLLERDEVICEADDED:`

To be fair this may not solve all problems with error reporting - the main issue is just that Ren'Py tries to make an error message and skips over various other steps like declarations, which means it then gets caught on otherwise normal parts of the code. So that check is an attempt to ignore that particular problem if it arises, but it's possible it'll try throwing an error somewhere else instead.

And for the viewports, `controller_viewport` does not handle `side_` properties or automatically adding scrollbars unfortunately, so you'll need to explicitly set that up/add it instead. Notably, the following are equivalent (aside from the controller_viewport bit being a controller-compatible viewport obviously):

viewport:
    scrollbars "vertical"
    side_yfill True
side 'c r':
    yfill True
    controller_viewport:
        id 'whatever'
    vbar value YScrollValue("whatever")
Hope that helps!