In-Game Menu Editting/Screen Creation

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
Westeford
Regular
Posts: 151
Joined: Mon Jun 19, 2017 4:43 pm
Completed: 12 Hours to Die
Projects: Project Premonition
itch: westeford
Location: United States
Contact:

In-Game Menu Editting/Screen Creation

#1 Post by Westeford »

I'm still pretty new to Renpy so bear with my silly question.
I want to add another button called "Inventory" to the in-game menu. (The one that appears when you right-click in game.) It would be located above the "Save" button. After clicking it, it opens up a screen that behaves like the other options, but with the following. On the far left is a list of items sorted from top to bottom. They are highlighted when hovered. The list will have a vertical scroll bar on the left side of the list. To the right of the list is two boxes. The top box contains an image, the bottom box contains a description of the selected item. When an item on the list is clicked on, the image and description will change appropriately.\

The following image is what I'm imagining. Please excuse my poor drawing.
Menu Design.jpg
Sorry that it's sideways. sigh

So I guess what I'm asking is this.
1. How should I add this button to the in-game menu?
2. How should I create a simple screen with what I described.

If you can explain some of the functions used in simple terms, I'd very much appreciate it.
The design for my game is very simplistic.
I think I can figure out how to add and remove items to the list.
Thank you for your help.

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: In-Game Menu Editting/Screen Creation

#2 Post by irredeemable »

Well, to get it in the menu you'll need to find screen navigation(): in screens.rpy and add an entry, so it'd end up including:

Code: Select all

        if main_menu:

            textbutton _("Start") action Start()

        else:

            textbutton _("History") action ShowMenu("history")

            textbutton _("Inventory") action ShowMenu("inventory")

            textbutton _("Save") action ShowMenu("save")
Then create a new menu somewhere, just copy one of existing ones with the menu tag and take the guts out, so you'll end up with something like:

Code: Select all

screen inventory():

    tag menu

    use game_menu(_("Inventory")):
        # Your code goes here
Look into vpgrid for the scrolling list, the rest could be done in multiple ways but you should be able to find most everything you need on these pages: https://www.renpy.org/doc/html/screens.html https://www.renpy.org/doc/html/screen_actions.html

User avatar
Westeford
Regular
Posts: 151
Joined: Mon Jun 19, 2017 4:43 pm
Completed: 12 Hours to Die
Projects: Project Premonition
itch: westeford
Location: United States
Contact:

Re: In-Game Menu Editting/Screen Creation

#3 Post by Westeford »

irredeemable wrote: Wed Feb 21, 2018 7:40 pm Look into vpgrid for the scrolling list, the rest could be done in multiple ways but you should be able to find most everything you need on these pages: https://www.renpy.org/doc/html/screens.html https://www.renpy.org/doc/html/screen_actions.html
I got the button to work, but every time it's pressed, an error appears. "Exception: required parameter who has no value."

For now I would like to make a blank screen after pressing it so I can play around with the settings. Is there a way I can do that?
Thanks.

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: In-Game Menu Editting/Screen Creation

#4 Post by irredeemable »

Not sure what the error is from. You can put any of the UI elements in screen language in place of "# your code goes here" and it should work, even 'null' if you just want an empty screen.

User avatar
Westeford
Regular
Posts: 151
Joined: Mon Jun 19, 2017 4:43 pm
Completed: 12 Hours to Die
Projects: Project Premonition
itch: westeford
Location: United States
Contact:

Re: In-Game Menu Editting/Screen Creation

#5 Post by Westeford »

irredeemable wrote: Wed Feb 21, 2018 11:05 pm Not sure what the error is from. You can put any of the UI elements in screen language in place of "# your code goes here" and it should work, even 'null' if you just want an empty screen.
Found the problem.
I tried again in a fresh project and the code worked.
In my original project I deleted the quick menu.
Thank you.

Post Reply

Who is online

Users browsing this forum: No registered users