NicolasB
(NicolasB)
August 27, 2017, 4:17pm
1
Hi
I update the engine version from 4.16 to 4.17 and during the conversion of my project , I got this new build error
2> Running UnrealHeaderTool "D:\UnrealProject\RPGProject\RPGProject.uproject" "D:\UnrealProject\RPGProject\Intermediate\Build\Win64\RPGProjectEditor\Development\RPGProjectEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
2>D:/UnrealProject/RPGProject/Source/RPGProject/Item.h(40) : LogCompile: Error: Type 'TArray<FItemData>' is not supported by blueprint. Item.itemArray
Here is the code from one error
USTRUCT()
struct FItemData
{
GENERATED_USTRUCT_BODY();
FString name;
int32 id;
int32 bonus;
int32 quantity;
bool singleTarget;
bool offensive;
};
UCLASS()
class RPGPROJECT_API AItem : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AItem();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<FItemData> itemArray;
};
Because my project use a lot of TArray<> , the project can’t be convert…
Can someone help me
Thanks a lot !
PS : I don’t know if this question should be on engine or gameplay. Move to the right section if I post on the wrong section
Blue_man
(Blue_man)
August 27, 2017, 4:46pm
2
Try using
GENERATED_BODY() on structs, I think that is the new rule.
Zeblote
(Zeblote)
August 27, 2017, 5:08pm
3
I think you need to have USTRUCT(BlueprintType) now.
2 Likes
kamrann
(kamrann)
August 27, 2017, 7:52pm
5
As of 4.17, UHT now requires structs to be BlueprintType in order for them to be used a BlueprintReadWrite/ReadOnly properties. This was always the idea, it just wasn’t enforced until now.
Is the code exactly as you posted it? Your struct is gaining nothing from being a USTRUCT, nor is there any point to your use of EditAnywhere/BlueprintReadWrite on your array property, since no properties of your struct are reflected. You shouldn’t make the struct BlueprintType just to get it to compile, you should remove the reflection elements that you’re not actually using.
1 Like
NicolasB
(NicolasB)
August 27, 2017, 7:57pm
6
That works
Thanks !
EDIT : Kamrann : Thanks for the advice . I will change this structure
kamrann:
As of 4.17, UHT now requires structs to be BlueprintType in order for them to be used a BlueprintReadWrite/ReadOnly properties. This was always the idea, it just wasn’t enforced until now.
Is the code exactly as you posted it? Your struct is gaining nothing from being a USTRUCT, nor is there any point to your use of EditAnywhere/BlueprintReadWrite on your array property, since no properties of your struct are reflected. You shouldn’t make the struct BlueprintType just to get it to compile, you should remove the reflection elements that you’re not actually using.
I have the same error when switch my project to 4.17. This helps me a lot, thank you!