Crafting

UCrimsonCraftingRecipe

cpp
UCLASS(BlueprintType)
class UCrimsonCraftingRecipe : public UPrimaryDataAsset
{
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
TArray<FCrimsonItemConsumptionRequest> RequiredIngredients;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
TSubclassOf<UCrimsonInventoryItemDefinition> CraftedItemDefinition;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta = (ClampMin = "1"))
int32 CraftedItemQuantity = 1;
};

ACrimsonCraftingStationBase

Abstract world actor implementing ICrimsonInteractableTarget. CraftItem calls ConsumeItemsWithPriority across accessible inventories and grants the crafted item to the player.

cpp
UCLASS(Abstract, Blueprintable)
class ACrimsonCraftingStationBase : public AActor, public ICrimsonInteractableTarget
{
UFUNCTION(BlueprintCallable)
void CraftItem(UCrimsonInventoryManagerComponent* PlayerInventory, UCrimsonCraftingRecipe* Recipe);
UFUNCTION(BlueprintCallable)
void OnStationOpened(); // sets the current zone in the subsystem
UPROPERTY(EditAnywhere, BlueprintReadOnly)
FGameplayTagContainer AssociatedZoneTags;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
TObjectPtr<UCrimsonCraftingRecipeBook> RecipeBook;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
TSubclassOf<UGameplayAbility> OpenCraftingUIAbility;
};