Getting Started
Installation
Installing the Inventory System in your Godot project.
As its name implies, the inventory system is not just one component, but a collection of addons which together provide comprehensive inventory functionality.
The zip file contains the addons as part of an example project that contains a variety of examples including all the demos.
Setup
These instructions are for Version 2 of the inventory system. For version 1, please consult the PDF guide.
Add to a Godot project
After downloading the inventory system source code, copy the addons ("addons/gg_*") into your project.
Add Actions to InputMap
Add the inventory actions to your InputMap:
| Input Action | Description |
|---|---|
inventory_use_item | Uses an inventory item |
inventory_drop_item | Drops an inventory item |
inventory_transfer_item | Transfers an inventory item to another inventory |
inventory_split_item | Splits an inventory item |
These are used by the GGInventoryActionStrategyDefault.
Integrate the Inventory System
Integrate the inventory system by adding the relevant components to your entities, and adding the user interface components so the player can manage the inventory.
Familiarize yourself with how everything fit together by reading through the concepts section. In a nutshell, this consists of several parts:
- Add inventory capabilities to characters and objects, so they can store items.
This is done by adding the
GGInventoryandGGEntityAccessManagercomponents. - Configure the inventory user interface integration from the Inventory Settings.
- Add item use handlers to characters, so they can react to the player using consumables, equipping items, etc.
Advanced Setup
Custom Inventory User Interfaces
If you plan on creating a completely custom user interface, you can achieve this by implementing a new dialog strategy by extending the GGInventorySystemDialogStrategy class.
The gg_inventory addon includes two default reference implementations of how to integrate the inventory
with your game's user interface.
Instead of modals, you may prefer dialogs that are resizable and movable, which is a popular interface presentation for more complex RPGs. This is provided by the UIKit addons:
addons/gg_ui_kit: Provides an abstraction for user interface dialogs.addons/gg_ui_kit_dialog: Provides an implementation for movable and resizable dialog windows.addons/gg_ui_kit_modal: Provides an implementation for modal-based user interface dialogs.