I have an editor crash on loading.
It is cause when I add
ConstructorHelpers::FObjectFinder<UDataTable> GameObjectLookupDataTable_BP(TEXT("DataTable'/Game/ThirdPerson/GameObjectLookupTable.GameObjectLookupTable'"));
to my UGeneratorFunctionLibrary.
No minidump found for this crash.
.H
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "GeneratorFunctionLibrary.generated.h"
UCLASS()
class MYRUNNER_API UGeneratorFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "VictoryBPLibrary")
static FString GetHappyMessage();
};
.CPP
#include "MyRunner.h"
#include "GeneratorFunctionLibrary.h"
ConstructorHelpers::FObjectFinder<UDataTable> GameObjectLookupDataTable_BP(TEXT("DataTable'/Game/ThirdPerson/GameObjectLookupTable.GameObjectLookupTable'"));
//Happy Message
FString UGeneratorFunctionLibrary::GetHappyMessage()
{
return FString("Victory! Victory BP Library Works!");
}
If I move this string to GetHappyMessage() then Editor will have loaded but when I start game it will crash (because the function called on event begin play)
The path in ConstructorHelpers is true because I copy it from editor (RightClick on it → CopyReference)
The GameObjectLookupDataTable is created from class StrucGenerator in Editor and it is normal, i can edit it and save, is is ok.
.H
#pragma once
#include "StrucGenerator.generated.h"
USTRUCT(Blueprintable)
struct FStrucGenerator : public FTableRowBase
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GO")
int32 Rank;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GO")
int16 Category;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GO")
int32 Usecode;
FStrucGenerator()
{
}
};