How to extend the Landscape class?

Hello,

I have trouble creating a custom landscape class in C++.

Here is what I’ve done: I have created a new C++ project and added the “Landscape” and “LandscapeEditor” modules to the Build.cs file.

    PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Landscape", "LandscapeEditor" });

After that I’ve created a new class based on ALandscape. The header looks like this:

#pragma once

#include "CoreMinimal.h"
#include "Landscape.h"
#include "MyLandscape.generated.h"

UCLASS()
class MAPTEST_API AMyLandscape : public ALandscape
{
	GENERATED_BODY()
	
};

Unfortunately the compilation fails and I get a lot of linker errors. Does anyone know what could be the cause of this issue?

(By the way, is it possible to edit the map at runtime only by using the tools included in the engine - without using Voxel Plugin?)

Hi, I’m facing the same issue.

Somehow I made it work (was trying adding the landscape module), but then, by running a regeneration of the solution, the issue re-emerged.

Did you managed to find an answer?

I found the reason why. Landscape is marked with MinimalAPI, this means the functions will not be exposed in the modules, except the inline ones

Not sure if this can be modified without changing the landscape code (removing the MinimalAPI)