ADetourCrowdAIController in C++

I found this thread when converting to 4.23. I did have my AIController inheriting from ADetourCrowdAIController and could no longer compile. I did the following but it doesn’t work. I admit that I don’t understand syntactically how to make this work. Could someone comment on what I might have wrong here:

  1. I changed the inheritance in my h file to inherit only from AAIController and added my constructor with the FObjectInitializer as follows:

UCLASS()

class NEVERMEMORY_API AFPSAIController : public AAIController //ADetourCrowdAIController 

{

    GENERATED_BODY()

    AFPSAIController(const FObjectInitializer& ObjectInitializer);



  1. I put in a new constructor as follows:

AFPSAIController::AFPSAIController(const FObjectInitializer& ObjectInitializer)

: Super(ObjectInitializer.SetDefaultSubobjectClass<UCrowdFollowingComponent>(TEXT("PathFollowingComponent"))) {

}


  1. I added in the include file as “#include Navigation/CrowdManager.h”

After this I now get a compiler error from a macro in the engine source of:

Incomplete definition of type ‘UCrowdFollowingComponent’
Incomplete type ‘UCrowdFollowingComponent’ named in nested name specifier

Being lost here, I’m wondering if someone could tell me what I’ve done wrong, I’ve attempted to follow what the documentation states as noted above in haisong’s link.

2 Likes