Attempting to declare a C++ subclass of any Mover movement mode other than super basic ones causes import issues.
// Copyright (c) William Pimentel-Tonche and Refractor Software. All rights reserved.
#pragma once
#include "CoreMinimal.h"
#include "DefaultMovementSet/Modes/SmoothWalkingMode.h"
#include "RefractMovementMode_Walking.generated.h"
/**
* Generic on-ground walking mode that supports walk, run, sprint, and crouch movements.
*
* TODO(will) Someone didn't think the hierarchy through all the way, so we'll need to reimplement simple and smooth
* walking mode behavior on our end, or create a proxy class that can do the actual processing. Inheriting from
* anything other than UWalkingMode creates errors with the constructor that cannot be negated.
*/
UCLASS()
class REFRACTMOVER_API URefractMovementMode_Walking : public USmoothWalkingMode
{
GENERATED_BODY()
};
Build output:
---- Starting trace: 260110_234000 ----
UbaSessionServer - Disable remote execution (remote sessions will finish current processes)
[1/5] Compile [x64] RefractMovementMode_Walking.cpp
[2/5] Compile [x64] Module.RefractMover.cpp
[3/5] Link [x64] UnrealEditor-RefractMover.lib
[4/5] Link [x64] UnrealEditor-RefractMover.dll
0>Module.RefractMover.cpp.obj: Error LNK2019 : unresolved external symbol "public: __cdecl USmoothWalkingMode::USmoothWalkingMode(class FObjectInitializer const &)" (??0USmoothWalkingMode@@QEAA@AEBVFObjectInitializer@@@Z) referenced in function "void __cdecl InternalConstructor<class URefractMovementMode_Walking>(class FObjectInitializer const &)" (??$InternalConstructor@VURefractMovementMode_Walking@@@@YAXAEBVFObjectInitializer@@@Z)
0>Module.RefractMover.cpp.obj: Error LNK2019 : unresolved external symbol "public: __cdecl USmoothWalkingMode::USmoothWalkingMode(class FVTableHelper &)" (??0USmoothWalkingMode@@QEAA@AEAVFVTableHelper@@@Z) referenced in function "public: __cdecl URefractMovementMode_Walking::URefractMovementMode_Walking(class FVTableHelper &)" (??0URefractMovementMode_Walking@@QEAA@AEAVFVTableHelper@@@Z)
0>Module.RefractMover.cpp.obj: Error LNK2019 : unresolved external symbol "public: virtual __cdecl USmoothWalkingMode::~USmoothWalkingMode(void)" (??1USmoothWalkingMode@@UEAA@XZ) referenced in function "public: virtual __cdecl URefractMovementMode_Walking::~URefractMovementMode_Walking(void)" (??1URefractMovementMode_Walking@@UEAA@XZ)
0>UnrealEditor-RefractMover.dll: Error LNK1120 : 3 unresolved externals
Trace written to file C:/Users/impho/AppData/Local/UnrealBuildTool/Log.uba with size 4.7kb
Total time in Unreal Build Accelerator local executor: 2.40 seconds
Result: Failed (OtherCompilationError)
Total execution time: 4.44 seconds
0>Microsoft.MakeFile.Targets(44,5): Error MSB3073 : The command "C:\UE_5.7\Engine\Build\BatchFiles\Build.bat sigilEditor Win64 Development -Project="C:\Users\impho\OneDrive - Refractor Software\project\unreal\sigil\sigil.uproject" -WaitMutex -FromMsBuild -architecture=x64" exited with code 6.
Downgrading the base clas to UWalkingMode fixes it:
UCLASS()
class REFRACTMOVER_API URefractMovementMode_Walking : public UWalkingMode
{
GENERATED_BODY()
};
But it seems completely, and I mean genuinely indescribably insane, that whoever at Epic is responsible for Mover, would genuinely believe that Smooth/Simple walking mode classes should only be used from Blueprints (that is the only place I can currently create subclasses of them from). So I am assuming this is probably a mistake. Would like to know if there is anything I could be doing wrong.
Build file for my module:
// Copyright (c) William Pimentel-Tonche and Refractor Software. All rights reserved.
using UnrealBuildTool;
public class RefractMover : ModuleRules
{
public RefractMover(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
[
"AIModule",
"Core",
"EnhancedInput",
"GameplayTags",
"InputCore",
"MotionWarping",
"Mover",
"PoseSearch",
"RefractCommon"
]
);
PrivateDependencyModuleNames.AddRange(
[
"CoreUObject",
"Engine",
"Slate",
"SlateCore"
]
);
}
}
And plugin file correctly lists the dependency:
"Plugins": [
{
"Name": "EnhancedInput",
"Enabled": true
},
{
"Name": "Mover",
"Enabled": true
},
{
"Name": "MotionWarping",
"Enabled": true
},
{
"Name": "PoseSearch",
"Enabled": true
},
{
"Name": "RefractCommon",
"Enabled": true
}
]
Summary: Unless the maintainers of the Mover plugin genuinely expect us to create subclasses of the Smooth/Simple walking modes entirely in Blueprint and not at all in C++ for any reason, the API export for the Smooth/Simple walking mode classes (USmoothWalkingMode and USimpleWalkingMode) seem to be messed up. This is likely something worth fixing at the very least before Mover exits the experimental stage and needing to install an engine source build for modification purposes (over 400GB once installed) just to change a few export macros is completely asinine. So, I’d like to know if maybe I’m doing something wrong on my end.