Which class should I derive to create a C++ BTTask?

The BTTask_BlueprintBase class is very clear when it states a C++ class should not inherit it. Which class should I use then? And how do I include AIModule in may classes? I’ve tried several different paths, from “AIModule” to the most derived directory possible, yet it still fails to compile (using Unreal generated VC++ solution). With the 4.7 release will there be more complete documentation on AI and behaviour trees? Thanks!

Wow, three questions in one! :slight_smile:

To implement C++ BT tasks derive from UBTTaskNode for a plain node, or from UBTTask_BlackboardBase for some blackboard-related convenience features. Look at engine-supplied BT tasks for reference.

To link your project against AIModule you need to add it to your project dependencies in YourProjectName.Build.cs file, for example like so:

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

This has been answered multiple times already so you should exercise your search-fu more - there’s a lot information on AnswerHub already.

Regarding more AI documentation our docs team it working on them, and there’s already a fair amount of stuff on the epic wiki. Unfortunately AI team is producing features (and bugs!) a lot faster than docs team is able to document them :wink:

Cheers,

–mieszko