Hi all!
I’ve been following the Building and RPG in Unreal book (I’m super aware at how broken the code is, but I managed to correct it as I go.) and I’ve reached this little fun error that I’m totally unsure how to fix
TestDecisionMaker.h (8) - error C2504 : 'IDecisionMaker': base class undefined
TestDecisionMaker.h (10) - error C3668: 'TestDecisionMaker::BeginMakeDecision': method with override specifier 'override' did not override any base class methods
TestDecisionMaker.h(11) - error C3668 : 'TestDecisionMaker::MakeDecision' : method with override specifier 'override' did not override any base class methods
Normally the C2504 error would let me assume that the IDecisionMaker class hasn’t been included into the script, however
TestDecisionMaker.h
#pragma once
#include "IDecisionMaker.h"
class TestDecisionMaker : public IDecisionMaker
{
public:
virtual void BeginMakeDecision(UGameCharacter* character) override;
virtual bool MakeDecision(float DeltaSeconds) override;
};
It’s right there art the top and is inheriting from IDecisionMaker.
The next two errors I imagine are because it can’t define IDecisionMaker as the base class, but I’ll attach the TestDecisionMaker.cpp script below in case I’ve missed something.
#include "D---Around.h"
#include "TestDecisionMaker.h"
#include "TestCombatAction.h"
void TestDecisionMaker::BeginMakeDecision(UGameCharacter* character)
{
// pick a target
UGameCharacter* target = character->SelectTarget();
character->combatAction = new TestCombatAction(target);
}
bool TestDecisionMaker::MakeDecision(float DeltaSeconds)
{
return true;
}
(I’ve replaced the main header at the top with three - because this project was meant as a well…I don’t think Epic allows profanities here haha, basically thats the project header).
On topic, anyone encountered this before? I’ve been searching the forums and answerhub but can find either one error or the other, never both. Unless I haven’t searched the right thing.
Thanks in advance!