Add AI boilerplate

This commit is contained in:
baz 2024-06-12 21:42:22 +01:00
parent e06b1738c2
commit 3bd49b0b90
5 changed files with 127 additions and 1 deletions

View File

@ -0,0 +1,18 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "EnemyCharacter.h"
AEnemyCharacter::AEnemyCharacter(const FObjectInitializer& ObjectInitializer)
{
}
void AEnemyCharacter::BeginPlay()
{
Super::BeginPlay();
}
void AEnemyCharacter::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}

View File

@ -0,0 +1,31 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "VampireCharacter.h"
#include "BehaviorTree/BehaviorTree.h"
#include "EnemyCharacter.generated.h"
/**
*
*/
UCLASS()
class VAMPIRES_API AEnemyCharacter : public AVampireCharacter
{
GENERATED_BODY()
private:
UPROPERTY(EditDefaultsOnly, Meta = (AllowPrivateAccess = "true"))
UBehaviorTree* BehaviourTree;
public:
AEnemyCharacter(const FObjectInitializer& ObjectInitializer);
protected:
virtual void BeginPlay() override;
public:
virtual void Tick(float DeltaTime) override;
};

View File

@ -0,0 +1,31 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "VampireAIController.h"
AVampireAIController::AVampireAIController(const FObjectInitializer& object_initializer)
{
}
void AVampireAIController::BeginPlay()
{
Super::BeginPlay();
}
void AVampireAIController::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void AVampireAIController::OnPossess(APawn* InPawn)
{
Super::OnPossess(InPawn);
}
void AVampireAIController::OnDamaged(FDamageInfo info)
{
}
void AVampireAIController::OnDeath(FDamageInfo info)
{
}

View File

@ -0,0 +1,45 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "AIController.h"
#include "HealthComponent.h"
#include "PlayerCharacter.h"
#include "BehaviorTree/BehaviorTreeComponent.h"
#include "VampireAIController.generated.h"
/**
*
*/
UCLASS()
class VAMPIRES_API AVampireAIController : public AAIController
{
GENERATED_BODY()
private:
UBlackboardComponent* Blackboard;
UBehaviorTreeComponent* BehaviorTree;
APlayerCharacter* PlayerCharacter;
public:
AVampireAIController(const FObjectInitializer& object_initializer);
protected:
virtual void BeginPlay() override;
public:
virtual void Tick(float DeltaTime) override;
protected:
virtual void OnPossess(APawn* InPawn) override;
public:
UFUNCTION()
virtual void OnDamaged(FDamageInfo info);
UFUNCTION()
virtual void OnDeath(FDamageInfo info);
};

View File

@ -9,7 +9,8 @@
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"Engine"
"Engine",
"AIModule"
]
}
],