Spawn bot with player state? - 4.17

Figured this one out on my own. For anyone else with this question, here is what I did (again, this is Unreal Engine 4.17):

I created a C++ class. I named it BotAIController. It’s parent class is AIController.

In the .cpp file:

#include "BotAIController.h"


// Function that sets bWantsPlayerState.  bWantsPlayerState is a variable in the parent
void ABotAIController::SetWantsPlayerState(bool NewValue)
{
	bWantsPlayerState = NewValue;
}

In the .h file:

#pragma once

#include "CoreMinimal.h"
#include "AIController.h"
#include "BotAIController.generated.h"

/**
 * 
 */
UCLASS()
class SPECVS_MK3_API ABotAIController : public AAIController
{
	GENERATED_BODY()
	
public:

// Sets the variable bWantsPlayerState
	UFUNCTION(BlueprintCallable, Category = "PlayerState")
	void SetWantsPlayerState(bool NewValue);

};

Remember, if you name your project or controller something different, you will have to make some minor changes to the code.

That’s it! It was much more simple than the code for 4.4, which, for anyone interested, looked something like this:

.cpp file:

#include "BotAIController.h"



ABotAIController::ABotAIController(const class FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
	bWantsPlayerState = 1;
}

.h file:

#pragma once

#include "CoreMinimal.h"
#include "AIController.h"
#include "BotAIController.generated.h"

/**
 * 
 */
UCLASS()
class SPECVS_MK3_API ABotAIController : public AAIController
{
	GENERATED_BODY()
	
public:

	ABotAIController(const FObjectInitializer& ObjectInitializer);

};