This project builds upon my previous work, Simple Ren'Py Inventory, which was straightforward and beginner-friendly but lacked some advanced features that many games use today. So, I decided to level it up with this version, making it both simple enough for beginners and advanced enough for anyone who wants to get fancy with customization.
This system is designed with flexibility and dynamism in mind, allowing for effective item and slot management. Players can store, organize, and interact with items while also incorporating progression mechanics, like unlocking additional inventory slots as the game moves forward. It’s built for scalability, so whether you’re making a chill visual novel, a dating sim, or even a complex RPG, this should do the trick.
Oh, and about the tutorial... Listen, I'm not a tutorial wizard, but I tried my best to make the learning process less boring. You’ll find a step-by-step guide embedded in the visual novel itself, complete with some attempts at humor. I can’t promise it’s funny I mean, you’ll probably cringe at a few lines but hey, I did my best to keep it interesting. No promises on it being a cool step-by-step walkthrough. It's just a tutorial with a little personality, that’s all.
-
I’m not saying it’s the best tutorial out there, but... well, I tried. It's a step-by-step guide on how to use the inventory system, and I added a bit of dialogue to keep it... interesting. So, give it a try, and if you find yourself cringing at any of the jokes, I totally understand.
-
How to add and remove items.
-
How to unlock and lock inventory slots.
-
How to increase the total number of slots.
-
How the auto-sorting feature works after removing items.
Even if you’re new to Ren'Py or inventory systems, the tutorial will walk you through everything you need to know. And yes, you might cringe at a joke or two—but hey, at least it’s memorable!
Managing inventory slots has never been easier:
- Unlock Slots: Use the
unlock_slots(count)method to dynamically unlock additional slots during gameplay. For example, players can earn more slots as they progress through quests or levels. - Lock Slots: Use the
lock_slots(count)method to reduce the number of unlocked slots. This could simulate penalties, such as losing access to certain slots due to in-game events. - Increase Total Slots: Use the
increase_slot_count(additional_slots)method to expand the total number of slots available in the inventory. This is perfect for games where players can upgrade their inventory capacity.
The system ensures that only unlocked slots are accessible for adding items, while locked slots remain inactive until unlocked.
The inventory system is designed to handle items intelligently:
- Stacking Items: Each slot can hold up to 99 of the same item. If you try to add more than 99 of an item, the system will automatically distribute the excess to other slots.
- Adding Items: When adding items, the system first tries to stack them in existing slots with the same item. If no space is available, it places the item in the next available empty slot.
- Removing Items: Use the
remove_item(item, quantity)method to remove items from the inventory. If you remove all instances of an item from a slot, the slot becomes empty. After removal, the inventory automatically sorts itself to ensure empty slots are pushed to the end. - Notifications: Custom notifications keep players informed about actions like successfully adding or removing items, insufficient slots, or invalid quantities. These notifications can include sound effects to enhance the user experience.
The inventory automatically sorts itself whenever items are removed. Empty slots are moved to the end, ensuring that filled slots are always grouped together at the beginning of the inventory. This keeps the inventory organized and visually appealing without requiring manual intervention.
The inventory system is highly customizable and can be adapted to fit any type of Ren'Py game:
- Adjust the initial number of slots and unlocked slots during initialization.
- Modify the maximum number of items per slot (
max_items_per_slot) to suit your game’s needs. - Integrate custom notifications and sound effects to match your game’s theme.
Whether you’re building a simple dating sim or a complex RPG, this system provides the flexibility you need to create a seamless inventory experience.
- Modular notification system and easy to customize.
- Dynamic notifications for error handling and different scenarios.
- Easy to add sound and custom design notification pop-ups.
- Super simple notification function to avoid complexity.
This inventory system is designed to be easy to use, flexible, and (hopefully) not too tedious to learn, thanks to the tutorial. I can’t promise it’ll be a life-changing experience, but it should make inventory management in your Ren'Py project a lot smoother.
- Copy the Python class into your Ren'Py project.
- Adjust the slot count and item settings to your liking.
- Open the game and let the tutorial walk you through everything (or laugh... or cringe).
# Inventory initialization
default inventory = Inventory(slot_count=21, unlocked_slots=7)
# The start of the game
label start:
# Add Items
$ inventory.add_item("apple", 1)
$ inventory.add_item("orange", 1)
# Remove Items
$ inventory.remove_item("orange", 1)
# Unlock Slots
$ inventory.unlock_slots(7)
# Increase Slot Capacity
$ inventory.increase_slot_count(7)The folder structure in this project is designed with simplicity and modularity in mind. Unlike traditional Ren'Py projects where images, sounds, and scripts are scattered across default folders, this project organizes everything into self-contained modular components.
The goal is to provide a drag-and-drop, plug-and-play experience:
- Simply copy the
components/folder into your Ren'Py project. - Initialize the inventory system by declaring the
inventoryvariable in your script. - You're done! Everything—images, sounds, scripts—is already pre-configured and ready to use.
This approach ensures that:
- Ease of Use: No need to manually move files around or reorganize assets.
- Reusability: Each component (e.g., Inventory System, Custom Notification System) is standalone and can be reused in other projects.
- Scalability: Adding new features or components in the future won’t disrupt the existing structure.
- Now, let us delve into the folder structure itself. Do not be overwhelmed by the detailed folder structure I presented. Simply remember to copy the components folder into your game directory. That is all. This is merely a detailed example.
YourGameProject/
│
├── game/ # The main game directory (where all your scripts and assets go)
│ ├── components/ # Folder for modular components
│ │ ├── custom_notification/ # Modular component for custom notifications
│ │ │ ├── audio/ # Sound effects for notifications
│ │ │ │ ├── add_item_sound.ogg # Sound effect for adding items
│ │ │ │ ├── remove_item_sound.ogg # Sound effect for removing items
│ │ │ │ └── error_sound.ogg # Sound effect for errors
│ │ │ │
│ │ │ ├── images/ # Images for the notification system
│ │ │ │ └── gui/ # GUI-related images (e.g., notification popups)
│ │ │ │ └── notification_bg.png # Background for notifications
│ │ │ │
│ │ │ └── custom_notification.rpy # Python file for the notification logic
│ │ │
│ │ └── inventory_system/ # Modular component for the inventory system
│ │ ├── images/ # Images for the inventory system
│ │ │ ├── icons/ # Icons for items
│ │ │ │ ├── apple.png # Example item icon
│ │ │ │ └── orange.png # Example item icon
│ │ │ │
│ │ │ └── gui/ # GUI-related images (e.g., inventory UI)
│ │ │ └── inventory_bg.png # Background for the inventory screen
│ │ │
│ │ ├── inventory.rpy # Python file containing the Inventory class
│ │ └── screens.rpy # File for defining the inventory screen
│ │
│ │
Here is an example of how a default game folder should look. It may vary based on your game configuration.
This is just an example of a default game structure.
│ ├── screens.rpy # File for defining custom screens (e.g., main menu)
│ ├── options.rpy # File for game settings (optional)
│ └── script.rpy # Main game script file, Currently I put all my tutorial texted there.
│
└── README.md # Your project's README file (this file!)
- Engine: Ren'Py (Tested on version 8.0 and above)
- Language: Python (Integrated with Ren'Py scripting)
I’ve always found it weird that so many GitHub repos don’t have proper descriptions or tutorials. I mean, what's the point of sharing code if nobody knows how to use it? That’s why I made this inventory system easy to understand, with a tutorial that actually explains how it works step by step. Sure, I tried to make it a little fun—it’s just a friendly guide that’s more interesting than plain documentation.
I put in a fair amount of work creating this system. But when it came to the tutorial, let’s just say I was really hoping you’d find it helpful (and not too embarrassing). 😅 I mean, I don't have a lot of confidence in my humor, but if it helps you understand how to use this system, then I’ll call it a win! Enjoy, and don't hesitate to reach out if something doesn't make sense. Or if you have any brilliant ideas to take this system to the next level, I'm all ears! (Or if you just want to tell me how bad my jokes are). Cheers!


