Installation
This guide covers how to install Stack Inventory in your Godot 4 C# project.
Prerequisites
Section titled “Prerequisites”Before installing Stack Inventory, ensure you have:
- Godot 4.2+ with .NET support enabled
- C# Development Tools (Visual Studio Code, Visual Studio, or Rider)
- .NET 8.0 SDK or later
- A Godot C# project (not GDScript)
Installation
Section titled “Installation”Stack Inventory consists of two addon directories that must be placed in your project’s addons/ folder:
stack_inventory_godot/- Godot-specific nodes and resourcesstack_inventory_cs/- Core C# library with interfaces and POCS classes
Step 1: Add to Addons Folder
Section titled “Step 1: Add to Addons Folder”Place both addon directories in your project:
your-project/└── addons/ ├── stack_inventory_godot/ │ ├── plugin.cfg │ ├── StackInventoryPlugin.cs │ └── ... └── stack_inventory_cs/ ├── StackInventory.csproj └── ...Step 2: Enable the Plugin
Section titled “Step 2: Enable the Plugin”- Open your project in Godot
- Go to Project → Project Settings → Plugins
- Enable Stack Inventory
- Restart Godot Editor
Project Configuration
Section titled “Project Configuration”Verify .csproj References
Section titled “Verify .csproj References”After installation, verify your project’s .csproj file includes the Stack Inventory projects:
<Project Sdk="Godot.NET.Sdk/4.3.0"> <PropertyGroup> <TargetFramework>net8.0</TargetFramework> <EnableDynamicLoading>true</EnableDynamicLoading> </PropertyGroup>
<ItemGroup> <!-- Stack Inventory Core (POCS) --> <ProjectReference Include="addons/stack_inventory_cs/StackInventory.csproj" />
<!-- Stack Inventory Godot (Nodes/Resources) --> <ProjectReference Include="addons/stack_inventory_godot/StackInventoryGodot.csproj" /> </ItemGroup></Project>Build the Solution
Section titled “Build the Solution”cd your-projectdotnet build YourProject.csprojOr in Godot: Project → Tools → C# → Build Solution
Verification
Section titled “Verification”Test in Editor
Section titled “Test in Editor”- Create a new scene
- Add a
Node2DorNode3Das root - Try adding a
Pickup2DorPickup3Dnode as a child - If it appears in the “Add Child Node” dialog, installation succeeded!
Test in Code
Section titled “Test in Code”Create a test script:
using Godot;using StackInventory.Core.Items;using StackInventory.Game.Definitions;
public partial class InstallationTest : Node{ public override void _Ready() { GD.Print("Testing Stack Inventory installation...");
// Test POCS Item var item = new Item( System.Guid.NewGuid(), "Test Item", 10f, new System.Collections.Generic.List<ItemTag>(), 1 ); GD.Print($"✓ Created Item: {item.Name}");
// Test ItemDefinition var itemDef = new ItemDefinition { Name = "Test Definition", Value = 20f }; GD.Print($"✓ Created ItemDefinition: {itemDef.Name}");
// Test IItem interface IItem iitem = itemDef; GD.Print($"✓ IItem interface works: {iitem.Name}");
GD.Print("✓ Stack Inventory installation verified!"); }}Run the scene. You should see:
Testing Stack Inventory installation...✓ Created Item: Test Item✓ Created ItemDefinition: Test Definition✓ IItem interface works: Test Definition✓ Stack Inventory installation verified!Common Issues
Section titled “Common Issues””Cannot find type or namespace ‘StackInventory’”
Section titled “”Cannot find type or namespace ‘StackInventory’””Cause: Project references not set up correctly.
Solution:
- Check that both addons are in
addons/folder - Verify
.csprojhas<ProjectReference>entries (see above) - Rebuild:
dotnet buildor Project → Tools → C# → Build Solution - Restart Godot Editor
”Plugin not appearing in plugin list”
Section titled “”Plugin not appearing in plugin list””Cause: Missing plugin.cfg or incorrect folder structure.
Solution:
- Verify
addons/stack_inventory_godot/plugin.cfgexists - Check that folder structure matches:
addons/└── stack_inventory_godot/└── plugin.cfg ← Must be here
- Refresh Godot: Project → Reload Current Project
”Build errors about missing SDK”
Section titled “”Build errors about missing SDK””Cause: Wrong Godot.NET.Sdk version.
Solution:
- Check your Godot version: Help → About Godot
- Update
Godot.NET.Sdkin.csprojto match your Godot version - Example: Godot 4.3 →
Godot.NET.Sdk/4.3.0
”Submodule is empty after cloning”
Section titled “”Submodule is empty after cloning””Cause: Submodules not initialized.
Solution:
git submodule update --init --recursiveUpdating Stack Inventory
Section titled “Updating Stack Inventory”With Submodules
Section titled “With Submodules”cd addons/stack_inventory_godotgit pull origin main
cd ../stack_inventory_csgit pull origin main
cd ../..git add addons/git commit -m "Update Stack Inventory to latest version"Manual Installation
Section titled “Manual Installation”- Download new releases
- Replace contents of
addons/stack_inventory_godot/andaddons/stack_inventory_cs/ - Rebuild project
- Restart Godot
Uninstalling
Section titled “Uninstalling”Remove Submodules
Section titled “Remove Submodules”# Remove submodule entriesgit submodule deinit -f addons/stack_inventory_godotgit submodule deinit -f addons/stack_inventory_cs
# Remove from gitgit rm -f addons/stack_inventory_godotgit rm -f addons/stack_inventory_cs
# Remove from filesystemrm -rf .git/modules/addons/stack_inventory_godotrm -rf .git/modules/addons/stack_inventory_csManual Uninstall
Section titled “Manual Uninstall”- Disable plugin in Godot: Project → Project Settings → Plugins
- Delete folders:
addons/stack_inventory_godot/addons/stack_inventory_cs/
- Remove from
.csproj:- Delete
<ProjectReference>lines for Stack Inventory
- Delete
- Rebuild project
Next Steps
Section titled “Next Steps”Now that Stack Inventory is installed:
- Getting Started - Create your first item
- Architecture Guide - Understand the system design
- Tag System - Learn about item categorization
- API Reference - Explore available classes and methods