I’m trying to implement a cross-dependent structure like the one below. The problem with this code is UPROPERTY
that’s used above FDialogueNode* ReplyNode
. If one would exclude that line, this code would compile fine, however this property would not be exposed to Blueprint system.
struct FDialogueNode;
USTRUCT(BlueprintType)
struct FDialogueReply
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite)
FText ReplyText;
UPROPERTY(BlueprintReadWrite)
FDialogueNode* ReplyNode;
};
USTRUCT(BlueprintType)
struct FDialogueNode
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite)
TArray<FText> Lines;
UPROPERTY(BlueprintReadWrite)
TArray<FDialogueReply> Replies;
};
An alternative to the solution attempted above would be to remote the FDialogueReply
struct and use a TMap<FText, *FDialogueNode>
. However this is not allowed as well, both solutions would not compile, as I’m trying to use an undefined type.
How would I structure this to achieve the effect of, basically, a multi-linked list of sorts? Aside from using something like an ID
field, which I don’t think is elegant.