I’m storing each of my cutscenes in a specific struct I made to be imported from a CSV:
USTRUCT(Blueprintable)
struct FCutsceneDataRow : public FTableRowBase {
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Speech")
FString line;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Speech")
FName speaker;
};
In order to store and access these datatables, I created a second struct that’s just an ID,DataTable pair that I can set within the editor:
USTRUCT(Blueprintable)
struct FCutsceneReference {
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cutscene")
FName ID;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cutscene")
UDataTable* cutsceneData;
};
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<FCutsceneReference> cutsceneList;
That all works exactly as it’s supposed to. Where I’m starting to have problems is when it comes to getting that data into Blueprint. I made a BlueprintCallable function that takes a key, and returns the value:
UDataTable* UDatabaseManager::GetCutsceneDataTable(FName cutsceneID) {
for (int i = 0; i < cutsceneList.Num(); i++) {
if (cutsceneList*.ID == cutsceneID) {
return cutsceneList*.cutsceneData;
break;
}
}
return nullptr;
}
The problem is, this returns a generic UDataTable, not an array of FCutsceneDataRow. That means that I can’t use GetDataTableRow, because it doesn’t know what kind of data to check for:
I can’t connect the data table’s pin to a Cast node, which makes me assume that I can’t just cast my UDataTable* like I could a class, is there an intended workflow I’m missing to “jump” from generic data table to specific format?