Skip to content

Installation

This guide covers how to install Stack Inventory in your Godot 4 C# project.

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)

Stack Inventory consists of two addon directories that must be placed in your project’s addons/ folder:

  • stack_inventory_godot/ - Godot-specific nodes and resources
  • stack_inventory_cs/ - Core C# library with interfaces and POCS classes

Place both addon directories in your project:

your-project/
└── addons/
├── stack_inventory_godot/
│ ├── plugin.cfg
│ ├── StackInventoryPlugin.cs
│ └── ...
└── stack_inventory_cs/
├── StackInventory.csproj
└── ...
  1. Open your project in Godot
  2. Go to Project → Project Settings → Plugins
  3. Enable Stack Inventory
  4. Restart Godot Editor

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>
Terminal window
cd your-project
dotnet build YourProject.csproj

Or in Godot: Project → Tools → C# → Build Solution

  1. Create a new scene
  2. Add a Node2D or Node3D as root
  3. Try adding a Pickup2D or Pickup3D node as a child
  4. If it appears in the “Add Child Node” dialog, installation succeeded!

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!

”Cannot find type or namespace ‘StackInventory’”

Section titled “”Cannot find type or namespace ‘StackInventory’””

Cause: Project references not set up correctly.

Solution:

  1. Check that both addons are in addons/ folder
  2. Verify .csproj has <ProjectReference> entries (see above)
  3. Rebuild: dotnet build or Project → Tools → C# → Build Solution
  4. Restart Godot Editor

Cause: Missing plugin.cfg or incorrect folder structure.

Solution:

  1. Verify addons/stack_inventory_godot/plugin.cfg exists
  2. Check that folder structure matches:
    addons/
    └── stack_inventory_godot/
    └── plugin.cfg ← Must be here
  3. Refresh Godot: Project → Reload Current Project

Cause: Wrong Godot.NET.Sdk version.

Solution:

  1. Check your Godot version: Help → About Godot
  2. Update Godot.NET.Sdk in .csproj to match your Godot version
  3. Example: Godot 4.3 → Godot.NET.Sdk/4.3.0

Cause: Submodules not initialized.

Solution:

Terminal window
git submodule update --init --recursive
Terminal window
cd addons/stack_inventory_godot
git pull origin main
cd ../stack_inventory_cs
git pull origin main
cd ../..
git add addons/
git commit -m "Update Stack Inventory to latest version"
  1. Download new releases
  2. Replace contents of addons/stack_inventory_godot/ and addons/stack_inventory_cs/
  3. Rebuild project
  4. Restart Godot
Terminal window
# Remove submodule entries
git submodule deinit -f addons/stack_inventory_godot
git submodule deinit -f addons/stack_inventory_cs
# Remove from git
git rm -f addons/stack_inventory_godot
git rm -f addons/stack_inventory_cs
# Remove from filesystem
rm -rf .git/modules/addons/stack_inventory_godot
rm -rf .git/modules/addons/stack_inventory_cs
  1. Disable plugin in Godot: Project → Project Settings → Plugins
  2. Delete folders:
    • addons/stack_inventory_godot/
    • addons/stack_inventory_cs/
  3. Remove from .csproj:
    • Delete <ProjectReference> lines for Stack Inventory
  4. Rebuild project

Now that Stack Inventory is installed:

  1. Getting Started - Create your first item
  2. Architecture Guide - Understand the system design
  3. Tag System - Learn about item categorization
  4. API Reference - Explore available classes and methods