Inventories and Items

This page is not comprehensive. Check out the comments in FGInventoryComponent.h and FGInventoryLibrary.h for additional context and helper functions.

Item Descriptor (UFGItemDescriptor)

The native AFGItemDescriptor class, who would have thought, contains properties of Item-like game concepts. Notably, this is the base class for things like UFGBuildDescriptor (buildings) and UFGFactoryCustomizationDescriptor (Customizer patterns), which are not 'items' in the usual sense, and do not make use of all available UFGItemDescriptor properties.

Inventory Item (FInventoryItem)

Represents a single "instance" of an item descriptor and its associated item state (any kind of actor). Usually used when referring to items outside of inventories, for example, on belts.

Most items do not have state, and the game’s recipe system ignores item state. Equipment items use item state to store ammo/fuel levels, user settings, and other persistent data.

Item Amount (FItemAmount)

Associates an item descriptor class with a count of items, notably without an item state. Useful for representing quantities of items without regard to how they are being stored. Primarily used to define ingredients/products in recipes and costs of schematics.

Be careful converting these to/from Inventory Stacks to avoid losing item state data.

Inventory Stack (FInventoryStack)

Represents an Inventory Item as a stack of potentially multiple items. Unlike Item Amount, this maintains state data.

Be careful converting these to/from Item Amounts to avoid losing item state data.

Inventory Component (UFGInventoryComponent)

A USceneComponent used to attach a inventory, able to hold multiple Inventory Stacks at the same time, to a actor. This is not only used for the player, it’s nearly always used where you know there are items inside. That means you can think of them like a container full of items.