Lost Lily/Grid ToolkitDocs 1.0
Table of Contents

Add Inventory to a board in Unity

When to use

Add Inventory item types and starting contents to an authored board through the workflow below. Inventory does not introduce a separate board type: its items are structures with Inventory data. Here, “create Inventory board” means adding Inventory to an ordinary board, while “create Inventory item” means authoring an Inventory structure asset.

Before you start

Choose Square, Hex, or Triangle for the board. An item asset must use the same topology family as the board because its footprint and orientations are topology-specific. Review Choose your scene setup if you have not selected a renderer.

Procedure

1. Create the board

  1. Open Tools > Lost Lily > Grid Toolkit > Create Grid Board....
  2. Create the board and setup with the topology and renderer you need. World 3D is the simplest visible starting point.

2. Define an item type

  1. Create the matching item asset:
    • Square: Assets > Create > Lost Lily > Grid Toolkit > Inventory > Square Inventory Item.
    • Hex: Assets > Create > Lost Lily > Grid Toolkit > Inventory > Hex Inventory Item.
    • Triangle: Assets > Create > Lost Lily > Grid Toolkit > Inventory > Triangle Inventory Item.
  2. In the item Inspector, configure both responsibilities:
    • Structure: structure ID, footprint, occupancy layer, and orientation support.
    • Inventory: item ID, display name, category, sort key, icon ID, stacking, and maximum quantity.
  3. Assign a prefab, sprite, label, or composite structure visual to the item asset. The visual is optional for logical Inventory but required if the item should be visible.

These assets implement IGridInventoryItemAsset. The SquareGridInventoryItemAsset, Hex, and Triangle variants build equivalent Inventory metadata for their topology.

3. Register the item with the board

  1. Create Assets > Create > Lost Lily > Grid Toolkit > Structures > Structure Library, add the item asset, and assign that GridStructureLibraryAsset to the board setup.
  2. If the scene uses retained visualization, assign the same library to the GridStructureLibraryNodeBuilder.

4. Add a starting item

  1. Add an initial placement to the setup. Select the item structure ID, enter a unique instance ID, choose an anchor and orientation, and add Inventory/Quantity under initial extensions only when the starting quantity is greater than 1.
  2. Validate the item asset, structure library, and board setup. Enter Play Mode or invoke Build Board on GridBoardAuthoring.

Result

The board reports ready at revision 0. Its structure library resolves the item definition, the initial placement exists under the authored instance ID, and its quantity is the authored value or the implicit default of 1. A configured structure node builder displays the assigned visual.

Troubleshooting

Symptom Check
The setup rejects the item. Use an item asset from the same Square, Hex, or Triangle family as the board.
The initial placement fails. Inspect the anchor, orientation, footprint, layer, and overlap diagnostics in the setup report.
The item exists but is invisible. Assign a structure visual and make sure the renderer's GridStructureLibraryNodeBuilder uses the same library.
Quantity starts at 1. Add Inventory/Quantity to the placement's initial extensions and enter a value within the item's maximum stack.