So, I have been trying to implement custom anim nodes, but I have been running into a crapload of problems while trying to implement them with the outdated info found on the UE4 wikis and answerhub. I will probably hurl my PC through the room if I see another unresolved symbol error.
Anyways, to get the error out of the way:
Errors:
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "public: __cdecl FPA_AnimNode_StartCombo::FPA_AnimNode_StartCombo(void)" (??0FPA_AnimNode_StartCombo@@QEAA@XZ) referenced in function "public: __cdecl UPA_AnimGraphNode_StartCombo::UPA_AnimGraphNode_StartCombo(class FObjectInitializer const &)" (??0UPA_AnimGraphNode_StartCombo@@QEAA@AEBVFObjectInitializer@@@Z) MyGame I:\MyGame\Intermediate\ProjectFiles\PA_AnimGraphNode_StartCombo.cpp.obj 1
Error LNK2001 unresolved external symbol "public: __cdecl FPA_AnimNode_StartCombo::FPA_AnimNode_StartCombo(void)" (??0FPA_AnimNode_StartCombo@@QEAA@XZ) MyGame I:\MyGame\Intermediate\ProjectFiles\MyGameEditor.generated.cpp.obj 1
Error LNK1120 1 unresolved externals MyGame I:MyGame\Binaries\Win64\UE4Editor-MyGameEditor.dll 1 Error Failed to produce item: I:\MyGame\Binaries\Win64\UE4Editor-MyGameEditor.dll MyGame I:\MyGame\Intermediate\ProjectFiles\ERROR 1
Error MSB3075 The command ""I:\Game Development\Unreal4\Source\UnrealEngine 4.13.0\Engine\Build\BatchFiles\Build.bat" MyGameEditor Win64 Development "I:MyGame\MyGame.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command. MyGame C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 37
Anyways, I think the following classes are the root of the problem:
AnimGraphNode.h
Code:
#pragma once
#include "AnimGraphNode_Base.h"
#include "AnimGraphDefinitions.h"
#include "Kismet2/BlueprintEditorUtils.h"
#include "PA_AnimNode_StartCombo.h"
#include "PA_AnimGraphNode_StartCombo.generated.h"
UCLASS(MinimalAPI)
class UPA_AnimGraphNode_StartCombo : public UAnimGraphNode_Base
{
GENERATED_UCLASS_BODY()
UPROPERTY(EditAnywhere, Category = "Attacks")
FPA_AnimNode_StartCombo Node;
public:
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
virtual FText GetTooltipText() const override;
virtual FString GetNodeCategory() const override;
virtual FLinearColor GetNodeTitleColor() const override;
protected:
virtual FText GetControllerDescription() const;
};
AnimGraphNode.cpp
Code:
#include "MyGame.h"
#include "Editor/AnimGraph/Private/AnimGraphPrivatePCH.h"
#include "AnimationGraphSchema.h"
#include "AnimationRuntime.h"
#include "PA_AnimGraphNode_StartCombo.h"
#define LOCTEXT_NAMESPACE "PA_AnimGraphNode_StartCombo"
UPA_AnimGraphNode_StartCombo::UPA_AnimGraphNode_StartCombo(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
//title color
FLinearColor UPA_AnimGraphNode_StartCombo::GetNodeTitleColor() const
{
return FLinearColor(0.75f, 0.75f, 0.1f, 1.f);
}
//node category
FString UPA_AnimGraphNode_StartCombo::GetNodeCategory() const
{
return FString("Placeholder");
}
FText UPA_AnimGraphNode_StartCombo::GetControllerDescription() const
{
return LOCTEXT("StartComboNode", "Placeholder");
}
//get tooltip
FText UPA_AnimGraphNode_StartCombo::GetTooltipText() const
{
return LOCTEXT("PA_AnimGraphNode_StartCombo_Tooltip", "Placeholder");
}
//get node title
FText UPA_AnimGraphNode_StartCombo::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
return GetControllerDescription();
}
#undef LOCTEXT_NAMESPACE
I have also made sure to make a seperate editor module for my game, and placed the graph node header and implementation in folder associated with the module. As far as the module goes, this is how it’s been implemented.
GameEditor.Build.cs
Code:
using UnrealBuildTool;
public class MyGameEditor : ModuleRules
{
public MyGameEditor(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string[] {
"MyGame"});
CircularlyReferencedDependentModules.AddRange(new string[] {
"MyGame",});
PrivateIncludePaths.Add("EditorModule/Private");
PublicDependencyModuleNames.AddRange(new string[] {
"Core",
"CoreUObject",
"Engine",
"InputCore",
"UMG",
"Slate",
"SlateCore",
"RamaSaveSystem" ,
"AIModule",
"AnimGraph",
"AnimGraphRuntime",
"GameplayTasks",
"PhysX",
"APEX" });
PrivateDependencyModuleNames.AddRange(new string[] {
"UnrealED",
"AnimGraph",
"AnimGraphRuntime",
"BlueprintGraph"});
}
}
I know I have gone a bit overboard with the adds, but before I started to be showered with external symbol errors, this was a whole lot cleaner.
Anyways, I have no idea what I am doing wrong. I can kinda understand that the error lies with the AnimGraphNode, but I cannot for the life of me understand why it’s complaining. I have also tried changing GENERATED_UCLASS_BODY() to just GENERATED_BODY(), among a bunch of other things, but that only changes the errors visual studio throws at me.