Item Fragments
Item Fragments define modular behavior for inventory items. Each fragment adds a specific capability, such as being stackable, equippable, droppable, consumable, or usable as a container.
Fragments can contribute gameplay tags, runtime memory, operations, event handling, and integrations with other inventory systems. An item can combine multiple fragments to build its full behavior, such as a stackable consumable, a two-handed weapon, a nested bag, or a lootable item with quality and weight.
Fragment Summary
Fragment | Summary |
|---|---|
Consumable | Allows an item to be consumed, usually applying a Gameplay Effect to the owner. Supports single-use, stack-based charges, durability-based charges, or unlimited use. |
Container Placement | Defines where an item is stored, including its container and position. This is the standard placement fragment used by container layouts. |
Dimensions | Defines the 2D spatial footprint of an item for spatial layouts, including width, height, rotation, and optional occupancy masks. |
Drop | Allows an item to be removed from inventory and spawned into the world as a Pickup Actor. |
Durability | Tracks item wear, breakage, repair, and durability-based state. |
Dynamic Attributes | Defines item-level attributes that may use fixed values, random ranges, or level-based tables. These can also be exported to Gameplay Effects as Set By Caller magnitudes. |
Economy | Enables buying and selling logic, including price calculation, wealth validation, and item transfer. |
Equipment | Defines how an item behaves when equipped, including equipment states, runtime equipment instances, and soft asset references. |
Firearm | Allows configuration of ammo for a firearm. |
Gameplay Effect | Applies a Gameplay Effect to the owner while the item is active and its conditions are valid. |
Key | Allows an item to unlock external actors, optionally consuming the key when used. |
Level | Tracks an item's level and upgrade state. Also provides level data to other fragments, such as Gameplay Effect and Dynamic Attributes. |
Linked Container | Specialized placement fragment for items that occupy multiple containers at once, such as two-handed weapons occupying both main-hand and off-hand slots. |
Loot | Marks an item as eligible for loot selection and provides loot tags, context requirements, and selection weight. |
Nested Container | Gives an item its own internal container, allowing bags, crates, boxes, and similar storage items. |
Offhand | Defines an offhand anchor socket for equipment, usually used by animation systems such as FABRIK, CCDIK, or Control Rig. |
Prerequisites | Evaluates custom prerequisite objects to determine whether an item can be added to an inventory. |
Quality | Defines the item's quality tier, display text, color, and quality gameplay tag using the project's quality mapping table. |
Stack and Quantity | Defines stack size, maximum inventory quantity, stack merging, splitting, and stack-size events. |
User Interface | Provides UI-facing item data such as display name, category, description, and icon. |
Weight | Defines item weight and contributes to inventory encumbrance calculations, including stack-aware weight totals. |
Fragment memories store per-item runtime state for fragments that need data beyond the static item definition. These data structures can be saved, loaded, replicated, or transferred when items move between inventories.
Fragment | Memory | Description |
|---|---|---|
Container Placement |
| Stores the current container and position for the item. |
Dimensions |
| Stores the item's current rotation state. |
Durability |
| Stores the item's current durability. |
Dynamic Attributes |
| Stores default dynamic attribute values. Runtime attributes are stored separately by the item instance for optimized replication and access. |
Equipment |
| Stores the item's current equipment state. Created only when the item is placed in an Equipment layout. |
Level |
| Stores the item's current level. |
Linked Container |
| Stores the linked container reference and position used by the linked placement. |
Nested Container |
| Stores the nested container key owned by the item. |
Stack and Quantity |
| Stores the item's current stack size. |
Fragment Operations
The following operations are exposed by the fragments for runtime queries, state changes, and integration with inventory systems.
Fragment | Operation | Description |
|---|---|---|
Consumable |
| Returns whether the item can currently be consumed. |
Consumable |
| Applies the configured effect and updates stack or durability when applicable. |
Consumable |
| Consumes the item and returns the applied Gameplay Effect handle through a callback. |
Container Placement |
| Returns the item's default container from memory. |
Container Placement |
| Returns the container currently storing the item. |
Container Placement |
| Returns the item's current position in its container. |
Container Placement |
| Manually updates the item's container and position. |
Container Placement |
| Uses memory, default placement, preferred containers, or dynamic selection to resolve a container. |
Container Placement |
| Finds the best container for an item. |
Container Placement |
| Finds a valid position in the item's current container. |
Container Placement |
| Finds a valid position in a specific container. |
Container Placement |
| Attempts to add an item to a container and position. |
Container Placement |
| Attempts to move an item, swapping when needed. |
Container Placement |
| Swaps two items between their positions. |
Dimensions |
| Returns the item's original width and height. |
Dimensions |
| Returns the current dimensions, including rotation. |
Dimensions |
| Returns dimensions from default item memory. |
Dimensions |
| Returns whether the item supports rotation. |
Dimensions |
| Checks whether the item can rotate in its current occupied space. |
Dimensions |
| Returns whether the item is currently rotated. |
Dimensions |
| Returns whether default memory marks the item as rotated. |
Dimensions |
| Updates the item's rotation state. |
Drop |
| Spawns a Pickup Actor using the configured Environment Query and removes the item from inventory. |
Drop |
| Spawns a Pickup Actor at a specific location. |
Durability |
| Returns whether the item can break. |
Durability |
| Returns whether the item is currently broken. |
Durability |
| Returns whether default item memory represents a broken item. |
Durability |
| Returns whether the fragment marks the item as indestructible. |
Durability |
| Returns the item's maximum durability. |
Durability |
| Returns the item's current durability. |
Durability |
| Returns durability from default item memory. |
Durability |
| Sets the item's current durability. |
Durability |
| Reduces durability by a given amount. |
Durability |
| Restores durability to full. |
Dynamic Attributes |
| Checks whether the item has an attribute matching a tag. |
Dynamic Attributes |
| Returns an attribute value. |
Dynamic Attributes |
| Returns all runtime attributes for the item. |
Dynamic Attributes |
| Returns all attributes from default memory. |
Dynamic Attributes |
| Adds resolved attributes to default item data. |
Dynamic Attributes |
| Sets an attribute value. |
Dynamic Attributes |
| Removes an attribute from the item. |
Economy |
| Returns whether the item is marked as buyable. |
Economy |
| Returns whether the item can be sold. |
Economy |
| Checks whether the target has enough wealth to buy the item. |
Economy |
| Checks whether the source can sell the item to the target. |
Economy |
| Returns the unit buy price. |
Economy |
| Returns the unit sell price. |
Economy |
| Returns the stack-aware total buy price. |
Economy |
| Returns the stack-aware total sell price. |
Economy |
| Transfers the item to the buyer and deducts wealth. |
Economy |
| Transfers the item and grants wealth to the seller. |
Equipment |
| Updates the item's equipment state. |
Equipment |
| Returns the current equipment state. |
Equipment |
| Returns the definition for the current equipment state. |
Equipment |
| Returns the definition for a specific equipment state. |
Equipment |
| Returns soft asset paths referenced by equipment states. |
Equipment |
| Finds the Equipment Manager related to the item owner. |
Equipment |
| Returns the runtime equipment class used by the item. |
Gameplay Effect |
| Applies the Gameplay Effect when conditions pass. |
Gameplay Effect |
| Removes the Gameplay Effect. |
Gameplay Effect |
| Evaluates whether the effect should be applied. |
Gameplay Effect |
| Returns the level used for the Gameplay Effect. |
Gameplay Effect |
| Removes and reapplies the Gameplay Effect. |
Gameplay Effect |
| Responds to relevant item events, such as container or level changes. |
Gameplay Effect |
| Retrieves level data from the Level Fragment. |
Gameplay Effect |
| Evaluates effect level from a curve. |
Key |
| Attempts to use the key on an unlockable actor. |
Level |
| Returns whether the item can be upgraded. |
Level |
| Returns whether the item is at maximum level. |
Level |
| Returns the item's current level. |
Level |
| Returns level from default item memory. |
Level |
| Returns the maximum item level. |
Level |
| Sets the item's level. |
Level |
| Increases the item level when possible. |
Linked Container |
| Returns the linked container associated with the item. |
Linked Container |
| Checks whether a container matches the primary container query. |
Linked Container |
| Checks whether a container matches the linked container query. |
Nested Container |
| Returns the internal container owned by the item. |
Offhand |
| Returns the offhand anchor transform for an equipment instance. |
Prerequisites |
| Evaluates whether the item can be added to an inventory and returns a blocking reason if applicable. |
Quality |
| Returns the item's quality gameplay tag. |
Quality |
| Returns the localized quality name. |
Quality |
| Returns the quality color. |
Stack and Quantity |
| Checks whether two item stacks can merge. |
Stack and Quantity |
| Returns the maximum quantity allowed in the inventory. |
Stack and Quantity |
| Returns the maximum size of one stack. |
Stack and Quantity |
| Returns the current stack size. |
Stack and Quantity |
| Returns stack size from default item memory. |
Stack and Quantity |
| Sets the stack size. |
Stack and Quantity |
| Merges two stacks when possible. |
Stack and Quantity |
| Splits a stack into a separate item. |
Stack and Quantity |
| Counts the total quantity of matching items in the inventory. |
Stack and Quantity |
| Attempts to merge an item into existing incomplete stacks. |
User Interface |
| Returns the item's display name. |
User Interface |
| Returns the item's category text. |
User Interface |
| Returns the item's description text. |
User Interface |
| Returns the item icon. |
Weight |
| Returns the total item weight, including stack size. |
Weight |
| Calculates total inventory encumbrance from valid items. |
Weight |
| Updates the owner's encumbrance attribute. |
Fragment Events
Fragment events are emitted when a fragment changes meaningful item state, such as placement, durability, level, stack size, or equipment state. These events allow inventory systems, UI, and gameplay logic to react to item changes without tightly coupling to the fragment that produced them.
Fragment | Event | Description |
|---|---|---|
Container Placement |
| Emitted when the item's placement is initialized. |
Container Placement |
| Emitted when the item's container changes. |
Container Placement |
| Emitted when the item's position changes. |
Dimensions |
| Emitted when the item's rotation state changes. |
Drop |
| Emitted when the item is dropped and a Pickup Actor is spawned. |
Durability |
| Emitted when durability changes. |
Dynamic Attributes |
| Emitted when a dynamic attribute is added. |
Dynamic Attributes |
| Emitted when a dynamic attribute value changes. |
Dynamic Attributes |
| Emitted when a dynamic attribute is removed. |
Equipment |
| Emitted when the item's equipment state changes. |
Level |
| Emitted when the item level changes. |
Stack and Quantity |
| Emitted when the item stack size changes. |
Event payloads are the data structures sent with fragment events. They provide the context needed to understand what changed, such as the item involved, the previous value, and the new value.
Systems listening to fragment events can use these payloads to update UI, trigger gameplay reactions, synchronize state, or respond to inventory changes without needing to query everything manually.
Fragment | Payload | Events |
|---|---|---|
Container Placement |
|
|
Dimensions |
|
|
Drop |
|
|
Durability |
|
|
Dynamic Attributes |
|
|
Equipment |
|
|
Level |
|
|
Stack and Quantity |
|
|