Henrik-sv
(Henrik-sv)
October 25, 2019, 2:51pm
1
So I’m trying to build a conversation tree that easily can be edited in the editor.
So I have responses and conversation structs in c++.
Each response contains a conversation that contains a response that contains a conversation etc.
So something like this:
struct A
{
struct B b;
};
struct B
{
struct A a;
};
Now, this obviously does not compile since struct A does not know what struct B is.
To make matters worse they need to be blueprint UStructs.
Any help here or other ideas?
Rumbleball
(Rumbleball)
October 25, 2019, 2:52pm
2
struct A
{
struct B* b;
};
struct B
{
struct A* a;
};
Make A and B children of a base struct C then forward declare A and B on C’s header file before including it to A and B’s headers.
Henrik-sv
(Henrik-sv)
October 28, 2019, 8:18am
4
Yes both of these would work if..and this is a big if I didn’t have to keep both as Blueprint accessible.
The whole reason behind this is so that folks can easily edit these settings in the editor so them being displayed in the editor is incredibly important.
To my knowledge I can not forward declare a UStruct and have it as blueprint implementable.
Rumbleball
(Rumbleball)
October 28, 2019, 12:54pm
5
USTRUCT()
struct FDataA
{
...
};
USTRUCT()
struct FDataB
{
...
};
UCLASS()
class A
{
class B* b;
FDataA data;
};
UCLASS()
class B
{
class A* a;
FDataB data;
};
Missing GENERATED_BODY and public: