Yes, this question has been asked and yes, I did go through the possibilities:
- This question does not have missing includes (I checked this)
- This question has the correct UFUNCTION arguments
I suspect that this is to do with the fact my interface relies on an include of a custom class. Notably,
#include "CoreMinimal.h"
#include "SaveGame/MySaveGame.h"
#include "UObject/Interface.h"
#include "Savable.generated.h"
UINTERFACE(MinimalAPI)
class USavable : public UInterface
{
GENERATED_BODY()
};
class PROJECT_API ISavable
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Savable")
void CreateSaveState(UMySaveGame* SaveGameReference);
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Savable")
void LoadSavableState(UMySaveGame* SaveGameReference);
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Savable")
void OnLoadEnd();
};
In other words, it relies on MySaveGame. When using it in a class,
#include "CoreMinimal.h"
#include "MachinaMortem/Interfaces/Savable.h"
#include "GameFramework/Actor.h"
#include "PlayerOverlapBox.generated.h"
UCLASS()
class MACHINAMORTEM_API APlayerOverlapBox : public AActor, public ISavable
{
GENERATED_BODY()
/* VARIABLES*/
public:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Collision")
class UBoxComponent* BoxCollision;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ID Value")
int ID;
private:
bool bHasBeenTriggered;
bool bIsBlocked;
/* FUNCTIONS */
public:
APlayerOverlapBox(); // Sets default values for this actor's properties
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Savable")
void CreateSaveState(UMachinaMortemSaveGame* SaveGameReference);
virtual void CreateSaveState_Implementation(UMachinaMortemSaveGame* SaveGameReference) override;
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Savable")
void LoadSavableState(UMachinaMortemSaveGame* SaveGameReference);
virtual void LoadSavableState_Implementation(UMachinaMortemSaveGame* SaveGameReference) override;
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Savable")
void OnLoadEnd();
virtual void OnLoadEnd_Implementation() override;
// CUT OUT
This flat-out refuses to compile with the error:
error C2504: 'ISavable': base class undefined
Other interfaces which I have compile just fine. This does not. Therefore my questions are: what is happening and why?