I’m currently trying to reproduce the C++ State Machine plugin Live Training using 4.21.
Video and code source from here.
I can’t seem to compile my code as I keep getting a LogCompile: Error: Type 'FStateMachineResult' is not supported by blueprint. RunState.ReturnValue and UnrealHeaderTool failed for target 'PluginDevEditor' (platform: Win64, module info: <userpath>\PluginDev\Intermediate\Build\Win64\PluginDevEditor\Development\PluginDevEditor.uhtmanifest, exit code: OtherCompilationError (5)).
My code for the function uses the blueprintcallable for ufunction:
UFUNCTION(BlueprintCallable, Category = "State Machine")
virtual FStateMachineResult RunState(const UObject* RefObject,
const TArray<USM_InputAtom*>& DataSource, int32 DataIndex = 0, int32 RemainingSteps = -1);
Even after comparing the code to the source code provided in the training, i can’t seem to figure this issue out.
The return value is a struct, here’s the struct in question:
USTRUCT()
struct STATEMACHINE_API FStateMachineResult
{
GENERATED_USTRUCT_BODY()
UPROPERTY()
EStateMachineCompletionType CompletionType;
UPROPERTY()
USM_State* FinalState;
UPROPERTY()
int32 DataIndex;
};