Ive tried following the pickupbattery tutorial, but it doesn’t seem to work.
DMagicGameMode.h
#pragma once
#include "GameFramework/GameMode.h"
#include "DMagicGameMode.generated.h"
UCLASS(blueprintable)
class ADMagicGameMode : public AGameMode
{
GENERATED_BODY()
public:
ADMagicGameMode(const FObjectInitializer& ObjectInitializer);
UFUNCTION(BlueprintNativeEvent) void SetStringsDEBUG(int32 Index, FString Str);
};
DMagicGameMode.cpp
#include "DMagic.h"
#include "DMagicGameMode.h"
ADMagicGameMode::ADMagicGameMode(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
void ADMagicGameMode::SetStringsDEBUG_Implementation(int32 Index, FString Str)
{
}
Intellisense claims SetStringsDEBUG_Implementation is incompatible with its declaration.
.
ADMagicGameParent.h
#pragma once
#include "DMagicGameMode.h"
#include "DMagicGameParent.generated.h"
UCLASS()
class DMAGIC_API ADMagicGameParent : public ADMagicGameMode
{
GENERATED_BODY()
public:
ADMagicGameParent(const FObjectInitializer& ObjectInitializer);
virtual void SetStringsDEBUG_Implementation(int32 Index, FString Str) override;
};
There is another Intellisense error here, but I am assuming it is because of the above error.
ADMagicGameParent.cpp
#include "DMagic.h"
#include "DMagicGameParent.h"
ADMagicGameParent::ADMagicGameParent(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
void ADMagicGameParent::SetStringsDEBUG_Implementation(int32 Index, FString Str)
{
Super::SetStringsDEBUG_Implementation(Index, Str);
Destroy();
}
These are the error messages received from a compile:
DMagicGameParent.h(19): error C3668: 'ADMagicGameParent::SetStringsDEBUG_Implementation' : method with override specifier 'override' did not override any base class methods
DMagicGameMode.cpp(28): error C2511: 'void ADMagicGameMode::SetStringsDEBUG_Implementation(int32,FString)' : overloaded member function not found in 'ADMagicGameMode'
d:\documents\unreal projects\dmagic\source\dmagic\DMagicGameMode.h(9) : see declaration of 'ADMagicGameMode'
d:\documents\unreal projects\dmagic\source\dmagic\DMagicGameMode.h(11) : see declaration of 'ADMagicGameMode::SetStringsDEBUG_Implementation'
d:\documents\unreal projects\dmagic\source\dmagic\DMagicGameMode.h(9) : see declaration of 'ADMagicGameMode'
DMagicGameParent.h(19): error C3668: 'ADMagicGameParent::SetStringsDEBUG_Implementation' : method with override specifier 'override' did not override any base class methods
d:\documents\unreal projects\dmagic\source\dmagic\DMagicGameMode.h(11) : see declaration of 'ADMagicGameMode::SetStringsDEBUG_Implementation'
d:\documents\unreal projects\dmagic\source\dmagic\DMagicGameMode.h(9) : see declaration of 'ADMagicGameMode'
DMagic.generated.cpp(51): error C2511: 'void ADMagicGameMode::SetStringsDEBUG(int32,const FString &)' : overloaded member function not found in 'ADMagicGameMode'
d:\documents\unreal projects\dmagic\source\dmagic\DMagicGameMode.h(9) : see declaration of 'ADMagicGameMode'
DMagic.generated.cpp(55): error C2352: 'UObject::FindFunctionChecked' : illegal call of non-static member function