ID Value
An ID Value is a FName tied to a float Value.
It is the most fundamental value of a Complex Stat: Each time you modify the value of a Complex Stat, it's is through an ID Value.
ID Value Details
When getting an ID Value, you'll have acess to its details through a structure: ID Value Details.
Since the same ID can be present in numerous Value Sets and Stats (a "Great_Sword" might increase the Regular and Multiplier Value Sets of
Strength, and the Regular Value Set of Constitution), this function gives you the full details of where you can find that ID and its corresponding
value.
Only Complex Stats and Value Sets that contain the ID will be present in the structure.
You can also get the ID Value directly from a Complex Stat. This will return the Value Sets that contain this ID and its value.
When using ID Value Details, the structure that comes when you call GetIDValue() from the StatsComponent, some additional tools will help you process the informations.
Break
You can break the ID Value Details structure to have access to the full informations.
Arrays are wrapped in structures, so don't hesitate to split the structure pins.
Get From Complex Stat
Instead of breaking the ID Value Details structure, you can use GetFromComplexStat().
If no Value Set contains the ID for this Complex Stat, there won't be any element in the array.
Get From Value Set
You can also use GetFromValueSet().
ID Value Modifier or Setter
From the StatsComponent, you can call ApplyIDValueModifier() or ApplyIDValueSetter() to modify or set an ID Value across multiple Complex Stats and Value Sets at once.
This will use an ID Value Modifier structure, which is especially useful when used in pair with a data container.
I want to design an equipment system.
-
Create a structure that will hold the informations about my items.
-
Add ID Value Modifier to my structure.
- Create a Data Table using this structure.
- Add rows and fill the informations.
Here, my item "Great_Sword" will increase the Regular value of Strength by 2 and its Multiplier by 0.1. It will also increase my Constitution by 1.
- Create an EquipItem() function and call ApplyIDValueSetter()
- Create an UnequipItem() function and call RemoveIDValue()