Inventories and Items

This page doesn’t just describe the inventory itself, but also everything else that is used by it.

Item Descriptor (UFGItemDescriptor)

The native AFGItemDescriptor class, who would have thought, describes an Item itself. It holds information like:

  • Name

    The actual displayed name to the user

  • Description

    A description of the item itself. Most of the time it contains information about its usage but also some useless information.

  • Inventory Icon

    The icon you can see in your inventory is no live rendering of the item, instead, it’s just a simple image file.

  • Conveyor Model

    This is a Static Mesh used to display the item in the 3D Environment like on a Conveyor belt.

  • Radioactive Decay

    Some items like Uranium Ore cause radiation damage to the player when nearby. This field stores information about the radiation emitted by the item.

  • Energy value (for use as Fuel)

    Different items have different amounts of energy storage when used as fuel. Coal, for example, has less energy than Packaged Fuel when used in a vehicle.

Sometimes you don’t need to define all of these fields. For example, when you want to create a building descriptor, you won’t need a model for conveyors or an energy value cause you don’t want to throw a building into a generator or move buildings around on belts.

Item (FInventoryItem)

This structure contains information about a item (class pointer to a item descriptor) and its connected item state (any kind of actor).

ItemAmount (FItemAmount)

This struct connects just a item descriptor and a count of items without a state. That means, this structure is not used to hold information the representation of a item ingame. Instead this is f.e. use in a recipe to define how many items of what type of item you need to bring up to get some different type of item with a different amount of them.

ItemStack (FItemStack)

This is the brother of ItemAmount but this time it holds a Item and a count. That means, this time, it is actually used to hold information about item and its count ingame. F.e. how many items of what kind are in one player inventory slot?

FGInventoryComponent (UFGInventoryComponent)

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