The attributes of an item are inherent, including fixed and variable attributes. For example, if an item has durability, it needs to add both fixed and variable attributes of durability
Fixed attributes (UItemAttribute_Stats): Used to store some fixed attribute data, such as maximum durability, materials required for production, mesh volume, etc
Variable attributes(UItemMutableAttribute):Store variable data, such as current durability, current ammunition remaining quantity, and current reinforcement information
Fixed attributes do not require network replication, variable attributes will participate in network replication, and serialization has been implemented
All attributes can be inherited and modified in the blueprint
Variable attributes require the implementation of a Replication function, which is used to copy attributes from an attribute (in ItemBuildInfo) to the corresponding item variable attribute. Only the variable of Other needs to be written to the corresponding variable
Example(C++):
virtual void Replication_Implementation(UItemMutableAttribute* Other) override {
UItemMutableAttribute_Durability* OtherAttribute = Cast<UItemMutableAttribute_Durability>(Other);
Durability = OtherAttribute->Durability;
bIsBreak = OtherAttribute->bIsBreak;
}
Variable attribute:
UItemMutableAttribute | Variable attribute |
---|---|
Replication | Copy function, which implements the function of copying variable attributes of the corresponding item from BuildInfo |
UItemMutableAttribute_Durability | DurabilityVariable attribute |
Durability | Current Durability |
bIsBreak | Is Item Breaked |
UItemMutableAttribute_LauncherWeapon | Launcher Variable attribute,For example, bows, guns, etc |
AmmoClass | Ammunition item foundation (ammunition type) |
ClipAmmo | Remaining ammunition, the remaining ammunition of this weapon (ammunition in the magazine), does not count as items in inventory |
UItemMutableAttribute_Enhance | Enhance Variable attribute |
StarRating | Current star rating |
StatPoints | An array of enhancement points, where the enhancement bonus values are stored |
ExtraStatPoints | Special enhancement point array, storing non player attribute enhancements, such as item durability enhancement |
Fixed attribute:
UItemAttribute | Fixed attribute |
---|---|
AttributeType | Attribute Type,EItemAttributeType |
MutableAttribute | Variable attribute create |
UItemAttribute_Enhance | Enhance Fixed attribute |
bManualEnhance | Allow active reinforcement, such as items that require players to use materials on the reinforcement platform for reinforcement, not the system |
MaxStarRating | Maximum Enhancement, Star Rating |
EnhanceTable | Strengthening platforms, such as workstations, strengthening platforms |
EnhanceResource | Materials required for strengthening (basic) |
EnhanceResourcePow | Reinforcement Material Usage Index Algorithm: Resource=Default+Default * StarRating ^ EnhanceResourcePow), adjust the amount of strengthening materials based on star rating, and fill in 1. f if no material is added step by step |
EnhancementSuccessProbability | Enhance the probability of success and consume materials in case of failure |
EnhancementFailureBreakProbability | The probability of destruction after reinforcement failure, 0 to 1, where 0 is not destroyed |
bRemoveAfterBreak | If the enhancement fails and it is destroyed, it will be directly removed. If false, the durability will return to 0, and if true, the item will disappear |
bAllowAppointEnhanceStat | Allow players to specify attributes for reinforcement, for example, players only enhance the attack power of weapons, fill in true if random reinforcement is not performed, or enable this function to specify attribute ID -1 for random reinforcement |
EnhanceStats | Strengthen the basic attribute array (one item at a time) |
EnhanceExtraStats | Special strengthening of basic attributes, such as durability |
Enhanced explanation | Randomly generate a reinforcement rate based on the maximum and minimum reinforcement rates for each item in the reinforcement attribute list and add it to the reinforcement variable attribute list Enhanced attribute algorithm: Original attribute value * Basic attribute multiplier * Enhancement multiplier Balance adjustment can adjust the original attribute value and the base attribute multiplier, The original attribute value affects the attributes of unreinforced and reinforced items The basic attribute multiplier only affects the strengthened item attributes |
FItemEnhance/FItemExtraEnhance(Struct) | |
StatType | Attribute Type |
BaseMultiply | Basic attribute multiplier |
ProbabilityWeight | Probability weight, used for random reinforcement |
MinEnhanceMultiply | Minimum reinforcement rate |
MaxEnhanceMultiply | Maximum reinforcement rate |
UItemAttribute_Equip | Fixed attributes of equipment, including equipment bar and shortcut bar |
EquipSlotType | Equipment slot type |
ItemActorClass | Item sub entity type, used to generate weapons and other entities, clothing and other appearances are not set here |
UItemAttribute_RequiredLimit | Restricting fixed attributes, used to restrict players from wearing level equipment, etc |
MinLevel | Minimum level |
UItemAttribute_Stats | Fixed equipment value attribute |
Stats | Attribute array |
bApplyStatsWhenEquip | Apply it to the status component when equipping, for example, adding attributes when equipping clothes to the equipment bar, removing and subtracting attributes, and doing nothing on the shortcut bar |
UItemAttribute_Durablity | Durable fixed attribute |
MaxDurability | Maximum durability |
bCanDecay | Can it decay? After a certain period of time, the item will decay and cannot be used or removed |
DecaySecond | Decay time, in seconds, will only spoil one item at a time. The durability of the remaining items after decay will be reset |
DecayGiveItem | Give items after decay, such as giving players rotten meat items after meat decay |
bDisableRemoveAfterDecay | Whether to remove items after decay, such as weapons with decay time, which can be repaired after decay, but using this function will not be able to provide them during decay DecayGiveItem |
UItemAttribute_StaticMesh | Static mesh fixed attribute |
StaticMeshs | Static mesh array, used to add static meshs to items, such as weapons |
UItemAttribute_SkeletalMesh | Bone Mesh Fixed Attributes |
SkeletalMeshs | Bone mesh, used to add bone mesh to items, such as armor |
UItemAttribute_Use | Use fixed attributes, such as meat being edible |
UseType | Usage type Self implementation in Delegate delegation GiveBuff ModifyStatus increases attribute values, such as restoring health after using a blood bottle or increasing hunger through food. This mode is for fast recovery and requires an increase in the use of CDs. If slow recovery is required, please use GiveBuff mode |
UseColdDown | Use cooling time |
ColdDownGroup | Cooling grouping, such as using the same cooling CD for large and small blood bottles, setting this item to the same name is sufficient |
ModifyStats | Add a list of attribute values for use in ModifyStatus mode |
GiveBuff | Add BUFF and use it in GiveBuff mode |
UseMode | Usage mode for playing sound effects and animations, Need to delegate inventory component ->OnItemUseNotify |
UItemAttribute_Craft | Craft fixed attribute |
Resource | Materials required for production once |
GiveQuantity | How many items to give at once |
ExtraItem | Craft one and give extra items |
CraftTable | Craft platform, such as workbench, machine tool |
CraftTime | Time required for Craft |
CraftGroup | Craft groups for UI grouping |
bCanRepair | Can it be repaired? The materials used for repair will vary based on the current durability, and the minimum cost for one repair is 1 material per sample |
RepairConsumptionPercentage | The material multiplier required for repair, default to 0.5, only half of the material needed to repair a damaged item at once |
bUseCustomRepairResource | Use custom materials to repair items. If you use this option, the RepairConsumptionPercentage will not be used, and the current durability will not be calculated. For example, one sharpening stone will be consumed each time you repair a weapon |
CustomRepairResource | Custom repair materials |
UItemAttribute_Weapon | Weapon Fixed Attribute |
bUseAmmunition | Equipped with a magazine that can store bullets |
AvailableAmmunition | Permissible types of weapons and ammunition |
UItemAttribute_Projectile | Fixed attributes of missiles, such as arrow items |
ProjectileClass | Type of missile,APrimalProjectile |