Dynamic Attributes Fragment
The Dynamic Attributes fragment allows you to define custom attributes for an item.
Each attribute can be assigned a fixed value or a random range that is resolved when the item is created.
Application
This fragment implements IInventoryItemMagnitudeInterface, which is used by an Item Instance to set magnitudes to any gameplay effect applied either from the Gameplay Effect Fragment or by an active Equipment State.
Fragment Tags
This fragment does not introduce any specific gameplay tags by default.
Properties
This can define multiple attributes, each with the following properties.
Property | Description |
|---|---|
| Unique tag identifying the attribute. |
| A localized name that can be used internally or with the user interface. |
| A localized description that can be used internally or with the user interface. |
| Determines if the attribute’s value is fixed or randomly resolved from a range. |
| Value assigned when |
| Minimum possible value when |
| Maximum possible value when |
| If true, this attribute will be exported to Gameplay Effects as a Set By Caller magnitude. |
Memory
The fragment supports default memories via the FInventoryItemFragmentAttributeMemory struct.
From the item instance’s perspective, dynamic attributes are stored in a dedicated memory structure separate from other fragment memories, allowing for optimized replication and runtime access.
Operations
This fragment exposes the following operations:
Function | Description |
|---|---|
| Returns |
| Retrieves the attribute value for the provided item. |
| Retrieves all attributes and values for the given item. |
| Retrieves all default attributes and values from the item’s default memory. |
| Applies all attributes (resolving random ranges if needed) to a default item. |
| Sets the attribute value for the provided item. |
| Removes the attribute from the provided item. |
Events
The fragment triggers the following events, all using the FInventoryItemAttributesPayload struct:
Inventory.Event.Item.DynamicAttribute:.Created: A new attribute is added to an item..Updated: An attribute value changes..Removed: When an attribute is removed from an item.
Gameplay Effect Integration
When bExportAsSetByCaller is enabled in an attribute, its value can be injected into a Gameplay Effect Spec as Set By Caller magnitudes, allowing them to directly influence ability and effect calculations.
Eligible attributes are exposed via IInventoryItemMagnitudeInterface.