The issue was posted by me at this thread back in March, but it took me some time before I could get to my issue once more.
Looks like previous thread contained too few useful information for possible solution, so I’ll try to me more precise right now.
I’ve made a custom editor and bunch of custom nodes, but I can’t copy/paste them between projects (copy node from editor in one project to editor of other projects).
After making some comparison between Behavior Tree Editor (I’ll call it BTE) and my tool I’ve figured out the issue, but still can’t find a solution for it.
To be able to operate at runtime custom node should have it’s runtime instance, that would contain all required information about node and keep it at runtime.
When making Copy (Ctrl+C) of BTE node I usually get an UnrealScript snippet similar to this one:
(I’ve deleted some stuff that is not related to Runtime Instance like node position, guid, node pin properties and other stuff.)
Begin Object Class=BehaviorTreeGraphNode_Task Name="BehaviorTreeGraphNode_Task_4"
Begin Object Class=BTTask_MakeNoise Name="BTTask_MakeNoise_4"
End Object
NodeInstance=BTTask_MakeNoise'BTTask_MakeNoise_4'
End Object
while UnrealScript of my node looks like this:
Begin Object Class=DialogueConduitNode Name="DialogueConduitNode_1"
NodeRuntimeInstance=DialogueConduitNodeRuntime'DialogueConduitNodeRuntime_1'
End Object
As expected, copying BTE node from one project’s to another project’s editor goes just fine, while copying of my node ends up with error.
I’ve manually added similar to BTE’s snippet lines to make mine look like this:
Begin Object Class=DialogueConduitNode Name="DialogueConduitNode_1"
Begin Object Class=DialogueConduitNodeRuntime Name="DialogueConduitNodeRuntime_1"
End Object
NodeRuntimeInstance=DialogueConduitNodeRuntime'DialogueConduitNodeRuntime_1'
End Object
And now copy/paste works pretty well, so the problem is when I make copy
Begin Object Class=DialogueConduitNodeRuntime Name="DialogueConduitNodeRuntime_1"
End Object
stuff is not generated.
Source of AIGraphNode can be seen here, but for me looks like important stuff should be seen in the header:
UCLASS()
class AIGRAPH_API UAIGraphNode : public UEdGraphNode
{
GENERATED_UCLASS_BODY()
/** instance class */
UPROPERTY()
struct FGraphNodeClassData ClassData;
UPROPERTY()
UObject* NodeInstance;
....
while mine looks like this:
UCLASS()
class DIALOGUETOOLEDITOR_API UDialogueNodeBase : public UEdGraphNode
{
GENERATED_BODY()
public:
UPROPERTY()
UDialogueNodeBaseRuntime* NodeRuntimeInstance;
UPROPERTY()
UClass* NodeRuntimeClass;
...
Are there any specific methods that should be used to generate Begin Object Class?