# Cross-dependent structure exposed to Blueprints

**URL:** <https://forums.unrealengine.com/t/cross-dependent-structure-exposed-to-blueprints/457586>\
**Category:** Architectural and Design Visualization\
**Tags:** list, unreal-engine, architecture, UE4, CPP, Blueprint, question\
**Created:** [October 26, 2019, 8:55pm UTC](https://forums.unrealengine.com/t/cross-dependent-structure-exposed-to-blueprints/457586 "2019-10-26T20:55:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mshvern](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mshvern](https://forums.unrealengine.com/u/mshvern)\
**Post date:** [October 26, 2019, 8:55pm UTC](https://forums.unrealengine.com/t/cross-dependent-structure-exposed-to-blueprints/457586/1 "2019-10-26T20:55:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [October 27, 2019, 1:18am UTC](https://forums.unrealengine.com/t/cross-dependent-structure-exposed-to-blueprints/457586/2 "2019-10-27T01:18:59Z")

</div>

Only UObject exist up in the air and be referenced, UE4 don’t track existence of structure it more like custom type of some sorts. This is not just problem with BT side but also C++ as if you delete pointed structure you gonna have invalid pointers.

Doing IDs one way… making actual UObjects for those is also a solution, this is how UE4 deals with nodes in graph-based assets, look up UEdGraphNode. If you making asset type, the default serialization will save referenced non-asset UObjects too and oyu always have option to make your own serialization.

---

<div class="post-metadata">

**Author:** ![mshvern](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mshvern](https://forums.unrealengine.com/u/mshvern)\
**Post date:** [October 27, 2019, 2:04am UTC](https://forums.unrealengine.com/t/cross-dependent-structure-exposed-to-blueprints/457586/3 "2019-10-27T02:04:24Z")

</div>

Thank you, I have dealt with by experimenting around. I haven’t realized there are certain limitations associated with structs, upon constructing something similar with a UObject’s instead it turned out to be trivial.
