Here are the steps I have followed, and it crashes every time. I create a new, blank project.
I click “Add code to project”, choose an Empty class and give it a name (CardDetail). I click the button to open in VS2013, which it does. I hit “build solution” in VS2013, switch back to the UE4 editor and can run the game without issue.
The code created is:
CardDetail.cpp
#include "Blank.h"
#include "CardDetail.h"
CardDetail::CardDetail()
{
}
CardDetail::~CardDetail()
{
}
CardDetail.h
#pragma once
/**
*
*/
class BLANK_API CardDetail
{
public:
CardDetail();
~CardDetail();
};
I then cut and paste the code from the official documentation into the .h file, after the #pragma, leaving the rest intact:
/** 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;
};
I get an error about missing ‘#include “CardDetail_generated.h”’, which I insert. This time 'Build solution" works.
I duplicate the comma-separated file listed in the official example. Back in the UE4 Editor, I drag and drop my .csv file onto the Content Explorer, but only the default GamePlayTagTableRow option exists under “DataTableOptions” in the importer dialog. I hit “Save All”, shut the editor, reopen the project, and the editor crashes.
Log is attached. (Cast of NULL to package failed)
What have I done wrong?