I have a custom UK2Node in a Plugin Editor-only Module. If I add the node to a BP, Play Standalone Game crashes.
Happens in 4.13 and 4.14, but not in 4.12 ! Also works fine in Simulate and Packaged.
AFAIK the custom node is expanded (as in ExpandNode is called), but the node is serialized in the compiled blueprint. So, when Standalone game loads the blueprint, the node fails to load (because it’s an Editor-only class), then it crashes in a UEdGraphPin de-serialize because it seems there is still a node with a pin to my node (which is null now).
Here is a very small Plugin and steps to reproduce of the bug:
- download the TestNodePlugin plugin
- add the TestNodePlugin to a project
- open a Level and its Level Blueprint
- add the blueprint function “Test Node Plugin”
- plug exec pin from “Begin Play” to “Test Node Plugin”
- launch Standalone game
- crash
Relevant logs when I launch Standalone Game:
[ 0]LogLinker:Warning: Can't find file '/Script/TestNodeEditorPlugin'
[ 0]LogUObjectGlobals:Warning: Failed to load '/Script/TestNodeEditorPlugin': Can't find file '/Script/TestNodeEditorPlugin'
[ 0]LogLinker:Warning: Can't find file for asset '/Script/TestNodeEditorPlugin' while loading NULL.
...
[ 0]LoadErrors: Info Failed to load /Script/TestNodeEditorPlugin.BPNode_TestNode Referenced by EventGraph
...
Assertion failed: LocalOwningNode [File:D:\Build\++UE4+Release-4.13+Compile\Sync\Engine\Source\Runtime\Engine\Private\EdGraph\EdGraphPin.cpp] [Line: 1449]
...
UE4Editor.exe has triggered a breakpoint.
The asserts seems to happen when de-serializing the exec pin in the “Begin Play” node.
Everything seem legit, the only bug I see is that my “Test Node Plugin” function is serialized in the compiled blueprint instead if it being expanded and removed.
I cannot even workaround by putting my node in the “Game” Module, because UnrealHeaderTool wont see my #if WITH_EDITOR
around the class, and does not know about UK2Node
in Game build.
I still hope it’s my fault, if not, it means I still don’t have a workaround, and will need to wait for a fix in the Engine.
Also, any workaround ideas is welcome !
Edit: typo