Hi everyone
I’m actualy working on the armor system on my project
but I have a little issue
An armor part can be composed of some modification, so I have an TArray modSlot
to store the mod list on the armor part.
basicly I have 3 class
AItem
→ a master class for all item (Armor and Mod)
AArmor
a class for all Armor
AArmorMod
a class for all mod
In UE4 I creat a new BP class that extend from AArmor
, and I create a BPthat extend from AArmorMod
but when I try to add my BP mod in the array (on the armor) I can’t see it on the list
This is the .h for the AArmor
and the AArmorMod
class
AArmor :
#pragma once
#include "ArmorMod.h"
#include "Item.h"
#include "Armor.generated.h"
UENUM(BlueprintType)
namespace EArmoryType
{
enum Type
{
AT_PLATE UMETA(DisplayName = "Plate Armor"),
AT_NANO UMETA(DisplayName = "Nano Armor"),
AT_ENERGY UMETA(DisplayName = "Energetic Armor")
};
}
UENUM(BlueprintType)
namespace EArmoryPart
{
enum Part
{
AP_HEAD UMETA(DisplayName = "Head"),
AP_TORSO UMETA(DisplayName = "Torso"),
AP_RIGHT_ARM UMETA(DisplayName = "Right Arm"),
AP_LEFT_ARM UMETA(DisplayName = "Left Arm"),
AP_RIGHT_LEG UMETA(DisplayName = "Right Leg"),
AP_LEFT_LEG UMETA(DisplayName = "Left Leg")
};
}
UCLASS()
class AArmor : public AItem
{
GENERATED_UCLASS_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Armor")
TEnumAsByte<EArmoryType::Type> ArmorType;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Armor")
TEnumAsByte<EArmoryPart::Part> ArmorPart;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Armor")
int32 nbModSlot;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Armor")
TArray<AArmorMod*> modSlot;
};
AArmorMod :
#pragma once
#include "Item.h"
#include "ArmorMod.generated.h"
/**
*
*/
UCLASS(BlueprintType, Blueprintable)
class AArmorMod : public AItem
{
GENERATED_UCLASS_BODY()
};
AItem class contain only 2 properties, 2 string for nam and description of the Item