Ren’Py Inventory Script For Point & Click Games – With Context Menu

March 4, 2023
Ren'Py Inventory Script With Context Menu

A while back I made a requested tutorial on my channel for a drag & drop inventory system with Ren’Py. It was one of the first tutorials I did in fact and it’s the most viewed on my channel. The script for it is quite complicated and the code is quite long, but have still been used and appreciated by many looking for a drag & drop inventory system specifically.

In that tutorial, I added a context menu to the inventory items where you could choose to either inspect the item or drag it. When you pressed on the hand symbol, the item would snap to the cursor’s position and follow it until you clicked somewhere else, such as on another item in the environment to try to combine them.

I have since gotten many questions by viewers on how to customize the inventory in different ways and I realized that it would be good to create a new inventory system that allows for many of the requested functionalities to work. But for that I had to eliminate the drag & drop functionality as that was mainly what made the inventory system so complicated to use and to customize. Mainly when it came to using dialogue with a predefined character and a side image as we had to work our way around using the normal way of implementing dialogue.

A preview of the new Ren’Py inventory system for visual novel games using context menu’s!

So with this new inventory system I have developed, which is a Patreon exclusive script, it’s much easier to use dialogue with predefined characters, and we work with context menu’s for all items that can be interacted with in the environment and inventory. The context menu allows you to inspect and pick an item up or inspect and combine an item with something else, depending on what kind of item it is.

Ren'Py Inventory Script Using Context Menu's
An example of the context menu showing above an environment item.

To combine an item with something else, you simply click the cog icon (or whatever you like it to be) which then triggers a pop-up menu to appear where you can choose an item from the inventory to combine it with.

The script is made to work for point-and-click visual novel games, meaning, you have scenes (screens) in your game with imagebuttons that are the items that can be interacted with. They can be pick-able items that shows up in the inventory, locked containers where you can gain the items within, and doors that can be unlocked to enter into a new scene.

One of the challenges I see many struggle with when it comes to making point-and-click games using an inventory in Ren’Py (including me when I was first trying to come up with a system), is dialogue specifically. It can be difficult to have dialogue show up on top of screens as you often find yourself having to leave the screen entirely to have dialogue show up at all (such as when you jump or call labels from the screen). So with this system, I found a simple workaround which makes it seems as if you never left the screen you were in as the dialogue shows on top. Then when the dialogue is finished, you simply continue interacting with the screen you were already in.

Ren'Py Inventory Script Using Context Menu's
Example of dialogue shown on top of the inventory and on top of the scene in Ren’Py.

It’s a pretty neat system actually, and the script includes example code of how you can structure and organize your game to make the inventory easy to work. The way I structured the example Ren’Py project using this inventory makes it possible as well to rollback without issues, something that was not possible with the old drag & drop inventory system I made before.

If you’re interested in this inventory script, it is available to download on my Patreon by those in the tier “Supporter” or higher. The post where you can download the script/Ren’Py project also includes a video tutorial of how to use the script properly and includes a lot of useful information.

If you do decide to join, even if it’s only for a month to access the script, I thank you for supporting my work. 😊 There’s also a bunch of other mini-game scripts you’ll gain access to and can use in your visual novel games, both for commercial and personal games. Check it out!

    Leave a Reply