How does the Crafting system work?
This system is used to “combine” any ItemDefinition with another, and from that to obtain a different one. Thus, achieving an improvement “upgrade”, “crafting”, “combination” etc.
It is important to note that the logic is based on the fact that the “combination” takes X time.
Therefore, there is a fragment to represent this logic.
Fragment_CrafItem
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “CraftFragment”)
float TimeToCraft = 1.f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “Craft Fragment”)
int32 StackReward = 1;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “Craft Fragment”)
TArray<FCraftItemRequirement> CraftItemRequirements;
A) Var: TimeToCraft (Float): In seconds, how long does it take to craft?
B) StackReward: (Int32): In quantity, how many items do I get when combining it?
C) CraftItemRequirment: [Struct], is an Array, of a struct called (CraftItemRequirement). Contains all the items you need to craft
UPROPERTY(EditAnywhere,BlueprintReadWrite, Category = “Craft Item”)
TSubclassOf<ULyraInventoryItemDefinition> ItemDefinition;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “Craft Item”)
int32 StackNeed = 1;