Download

Engine Crash

Hi,

Should be a simple question for experts.
I’ve created a new project C++/TopDown in version 4.13.2.

Added a new class based off the AIController. Below are the .h and .cpp files:
ABaseAIController.h


UCLASS()
class BASEMECH_API ABaseAIController : public AAIController
{
	GENERATED_BODY()
public:
	ABaseAIController();

	void BeginPlay() override;
	
	
	
	
};

ABaseAIController.cpp


ABaseAIController::ABaseAIController():Super() {
	//initialization here
	UE_LOG(LogClass, Log, TEXT("IN Initialize AIController@@@@@@@@@"));
	
	
}

void ABaseAIController::BeginPlay() {
	//Stuff like get controlling pawn etc.
	UE_LOG(LogClass, Log, TEXT("IN Begin Play AI@@@@@@@@@@@@@@"));
}


This is my Character class BaseMechCharacter.cpp and I’ve just added one line of code [well two including the comment] at the end of the constructor method:



	//Setup AI Class
	AIControllerClass = ABaseAIController::StaticClass();



When I hit play, I was expecting to see the log in init and the log in BeginPlay. I do see the log from constructor, pretty much after the compilation. But I don’t see the log from BeginPlay after I’ve hit play.

So, I thought, it’s probably because the template character spawns the blueprint, so I edited the blueprint and selected the above mentioned class from the dropdown for AIClass, and yet still not log from being play.

What am I missing??

Regards,

Sorry, the subject is misleading, i was going to post something else about an engine crash that i was having but then posted this question and forgot to change the title of the thread. Sorry about that, the crash is related though and happens if i do a Super::AAIController() in my class above. I am a java programmer essentially and after a quick research found that Super doesnt work with C++, the reason seemed quite logical, as Java does not allow for multiple inheritance and C++ does!. Anyway, engine did not crash after i removed that line!!??