Extending Editor by Modules

Hi there,

My problem is a little weird and is probably the result of a little misunderstanding about the build system, so I’m sorry!
Before I try to explain the situation, I have to say that I’m using the 4.4.3 build at the moment.

I tried to extend the features of my Editor by adding a new module, named BrEditor. This link on the answerhub and this one on the documentation helped me. (By the way, I wanted to ask : is the documentation up to date?).

Following these links, I have now these files in my architecture :

BassRider.Target.cs:

using UnrealBuildTool;
using System.Collections.Generic;

public class BassRidersTarget : TargetRules
{
	public BassRidersTarget(TargetInfo Target)
	{
		Type = TargetType.Game;
	}

	//
	// TargetRules interface.
	//

	public override void SetupBinaries(
		TargetInfo Target,
		ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
		ref List<string> OutExtraModuleNames
		)
	{
		OutExtraModuleNames.Add("BassRiders");

        if (UEBuildConfiguration.bBuildEditor)
        {
            OutExtraModuleNames.Add("BrEditor");
        }
	}
}

BassRidersEditor.Target.cs :

using UnrealBuildTool;
using System.Collections.Generic;

public class BassRidersEditorTarget : TargetRules
{
	public BassRidersEditorTarget(TargetInfo Target)
	{
		Type = TargetType.Editor;
	}

	//
	// TargetRules interface.
	//

	public override void SetupBinaries(
		TargetInfo Target,
		ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
		ref List<string> OutExtraModuleNames
		)
	{
		OutExtraModuleNames.Add("BassRiders");
        OutExtraModuleNames.Add("BrEditor");
	}
}

BrEditor.Target.cs :

using UnrealBuildTool;

public class BrEditor : ModuleRules
{
	public BrEditor(TargetInfo Target)
	{
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UnrealEd", "BassRiders" });
	}
}

BrEditor.h :

#ifndef __BREDITOR_H__
#define __BREDITOR_H__

#include "EngineMinimal.h"

#endif

BrEditor.cpp :

#include "BrEditor.h"


IMPLEMENT_GAME_MODULE(FDefaultGameModuleImpl, BrEditor);

If you want an overview of the files :

18266-overview.png

The problem is that this module was working fine for a whole month. But when my co-worker tried to pull my branch, he wasn’t able to compile the module. The funny part is… I’m now in the same situation and can’t build the project now (because I tried to reproduce this problem). I think that the problem lies in the Config/DefaultEngine.ini files. Mainly because I added things, and deleted it later. So my idea is that, because of some caching feature, I was able to automagically build the module despite the fact that my configuration wasn’t accurate.

Could you please provide me some informations to add modules to the UnrealEditor the proper way? If you have some links about the *Engine.ini files too, I’ll be glad to read them.

Thanks in advance for your help!

Hello there,

Here is the beginning of the far too long error output:

1>c:\program files\epic games\4.4\engine\source\runtime\coreuobject\public\uobject\Script.h(298): error C2061
1>c:\program files\epic games\4.4\engine\source\runtime\coreuobject\public\uobject\Script.h(298): error C4430
1>c:\program files\epic games\4.4\engine\source\runtime\coreuobject\public\uobject\Script.h(298): error C4183

Our problem is very similar to this one: What is the proper method for extending the Editor Engine? - C++ - Epic Developer Community Forums but sadly we weren’t able to fix it yet.

Thank you for your help

Hi again!

We managed to compile our module thanks to a weird trick.

1 : We deleted our client code, just keeping the module files (BrEditor.h, BrEditor.cpp);

2 : We deleted binaries/intermediate folders and regenerate the project files;

3 : We compiled successfully the solution with this useless module;

4 : We added the client code (MapBuilder.*), regenerate project files, and compiled the project successfully.

The thing is : we have to use this trick if we need to regenerate project files for any reason. I think that we made a mistake somewhere because my feeling is that the project is compiling thanks to incremental compilation (maybe the UObjects symbols are included in the “empty module compilation” and so, the second compilation works).

If anyone knows how to fix this, I thank you in advance Sir!

Hi again,

Here is the code inside our module that seems to cause the issue:

UCLASS()
class BREDITOR_API AMapBuilder : public APawn
{
    GENERATED_UCLASS_BODY()

};

Is there something specific in the declaration missing ?

Fixed

I was the prefixe of the file, fixed by renaming MyFile to [XX]MyFile.