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, I have the following:
AnimGraphNode.h
// Fill out your copyright notice in the Description page of Project Settings.
#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:
//UEdGraphNode Interface
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
virtual FText GetTooltipText() const override;
virtual FString GetNodeCategory() const override;
virtual FLinearColor GetNodeTitleColor() const override;
//virtual void CreateOutputPins() override;
//end of UEdGraphNode interface
protected:
virtual FText GetControllerDescription() const;
};
AnimGraphNode.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "PiratesAdventure.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("Attacks");
}
FText UPA_AnimGraphNode_StartCombo::GetControllerDescription() const
{
return LOCTEXT("StartComboNode", "Start Combo");
}
//get tooltip
FText UPA_AnimGraphNode_StartCombo::GetTooltipText() const
{
return LOCTEXT("PA_AnimGraphNode_StartCombo_Tooltip", "Starts or continues a combo, if the character in question has the functionality to do so");
}
//get node title
FText UPA_AnimGraphNode_StartCombo::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
return GetControllerDescription();
}
#undef LOCTEXT_NAMESPACE
AnimNode.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Animation/AnimNodeBase.h"
#include "PA_AnimNode_StartCombo.generated.h"
/**
*
*/
USTRUCT()
struct FPA_AnimNode_StartCombo : public FAnimNode_Base
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Links)
FPoseLink BasePose;
public:
FPA_AnimNode_StartCombo();
public:
virtual void Initialize(const FAnimationInitializeContext& Context) override;
virtual void Update(const FAnimationUpdateContext& Context) override;
};
AnimNode.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "PiratesAdventure.h"
#include "Private/EnginePrivate.h"
#include "PA_AnimNode_StartCombo.h"
FPA_AnimNode_StartCombo::FPA_AnimNode_StartCombo()
{
}
void FPA_AnimNode_StartCombo::Initialize(const FAnimationInitializeContext& Context)
{
BasePose.Initialize(Context);
}
void FPA_AnimNode_StartCombo::Update(const FAnimationUpdateContext& Context)
{
BasePose.Update(Context);
}
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
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class PiratesAdventureEditor : ModuleRules
{
public PiratesAdventureEditor(TargetInfo Target)
{
//Make sure Pirates Adventure is added as a search path.
PublicDependencyModuleNames.AddRange(new string] {
"PiratesAdventure"});
CircularlyReferencedDependentModules.AddRange(new string] {
"PiratesAdventure",});
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, the error I am having right now is;
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) PiratesAdventure I:\Game Development\Unreal4\Projects\PiratesAdventure\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) PiratesAdventure I:\Game Development\Unreal4\Projects\PiratesAdventure\Intermediate\ProjectFiles\PiratesAdventureEditor.generated.cpp.obj 1
Error LNK1120 1 unresolved externals PiratesAdventure I:\Game Development\Unreal4\Projects\PiratesAdventure\Binaries\Win64\UE4Editor-PiratesAdventureEditor.dll 1
Error Failed to produce item: I:\Game Development\Unreal4\Projects\PiratesAdventure\Binaries\Win64\UE4Editor-PiratesAdventureEditor.dll PiratesAdventure I:\Game Development\Unreal4\Projects\PiratesAdventure\Intermediate\ProjectFiles\ERROR 1
Error MSB3075 The command ""I:\Game Development\Unreal4\Source\UnrealEngine 4.13.0\Engine\Build\BatchFiles\Build.bat" PiratesAdventureEditor Win64 Development "I:\Game Development\Unreal4\Projects\PiratesAdventure\PiratesAdventure.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command. PiratesAdventure C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 37
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.