Setting up Datatables

EDIT: found i needed to extend from the datatable C++

However i cant create new C++ files.

This is a blank C++ Project and when adding code to the project extending the DataTable object i am presented with this error.



FIXED


I’m trying to import a data table for blueprint and I’m having trouble setting it up.

I have gone over the tutorial for it but I’m struggling with the C++ setup, i know basic code but haven’t looked at C++ I’m UE4 before.

I’m quite sure my problem is getting the correct parent class when adding C++ content to my project, has anyone set this up before that can point me in the correct direction.

The code from the example is

/** Structure that defines a level up table entry */
USTRUCT(BlueprintType)
struct FLevelUpData : public FTableRowBase
{
        GENERATED_USTRUCT_BODY()

public:

        FLevelUpData()
                        : XPtoLvl(0)
                        , XP(0)
        {}

        /** The 'Name' column is the same as the XP Level */

        /** XP to get to the given level from the previous level */
        UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=LevelUp)
        int32 XPtoLvl;

        /** This was the old property name (represented total XP) */
        UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=LevelUp)
        int32 XP;

        UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=LevelUp)
        TAssetPtr<UTexture> Asset;
};

Don’t have to make half on C++ and half on BP. You can do it all with BP only!

-m

…I’m currently working on this. Same like you , make a class out of DataTable class. Did you have any chance to get any worked sample or related link to this?

Actually, got some issue, when I import CSV file, I have a message said that first row item is not initialized … well, everything looks normal …
Error message: Expected Column “ItemNumber” not found in input.
and here is my CSV:

itemNumber,xpos,ypos,zpos,xrot,yrot,zrot,itemType,option01,option02,option03
0,1,1,0,0,0,0,wall,0,0,0
1,2,1,0,0,0,0,wall,0,0,0
2,3,1,0,0,0,0,wall,0,0,0
3,3,2,0,0,0,90,wall,0,0,0

… any help… ?

… well , the issue with CSV import is solved, Simply you need to put first column title “Name” or “” and add 0 to (max number of items)… for that like image below. But still no idea about the

UCLASS()
class NETWORKDIRECT_API UFItemInformation : public UDataTable
{
	GENERATED_BODY()


};

216580-sc-01.jpg

… solved… check this link :