A prototype inventory system for Godot 4 that demonstrates loading and managing game items from external JSON files. This project shows how to implement a flexible and easily expandable inventory system that can be modified without changing the game code.
Engine: Godot 4 Language: GDScript Storage: JSON UI: Native Godot Control nodes
├── data/
│ └── inventory_items.json # Item database
├── scripts/
│ ├── Inventory.gd # Core inventory logic
│ └── InventoryUI.gd # UI handling
└── scenes/
└── InventoryUI.tscn # Main inventory scene
Example of adding items to inventory
var inventory = preload("res://scripts/Inventory.gd").new()
inventory.add_item("health_potion", 5)
Add new items by editing the inventory_items.json file:
{
"new_item": {
"id": "new_item",
"name": "New Item",
"description": "Description",
"type": "type",
"properties": {
"custom_property": 100
},
"stack_size": 99
}
}
MIT License