Space Plunder
Loading...
Searching...
No Matches
AdvancedAIPerceptionComponent.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Perception/AIPerceptionComponent.h"
7#include "AdvancedAIPerceptionComponent.generated.h"
8
9
10DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnForgottenStimulus, FAIStimulus, Stimulus);
11
12
13UCLASS()
14class AITOOLKIT_API UAdvancedAIPerceptionComponent : public UAIPerceptionComponent
15{
16 GENERATED_BODY()
17
18public:
19 UPROPERTY(BlueprintAssignable)
20 FOnForgottenStimulus OnForgottenStimulus;
21
22 //- Currently only works with Sight & Hearing //
23 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
24 UAISenseConfig* GetPerceptionSenseConfig(const TSubclassOf<UAISense> SenseClass);
25 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
26 bool SetPerceptionSenseConfig(const TSubclassOf<UAISense> SenseClass, const bool DetectEnemies, const bool DetectNeutrals, const bool DetectFriendlies);
27
28 virtual void GetNeutralActors(TArray<AActor*>& OutActors) const;
29 void GetNeutralActorsBySense(TSubclassOf<UAISense> SenseToFilterBy, TArray<AActor*>& OutActors) const;
30
31 UFUNCTION(BlueprintCallable, Category = "AI Tool Kit")
32 void GetPerceivedNeutralActors(TArray<AActor*>& OutActors) const;
33 UFUNCTION(BlueprintCallable, Category = "AI Tool Kit")
34 void GetPerceivedNeutralActorsBySense(const TSubclassOf<UAISense> SenseToUse, TArray<AActor*>& OutActors) const;
35
36 virtual void GetFriendlyActors(TArray<AActor*>& OutActors) const;
37 void GetFriendlyActorsBySense(TSubclassOf<UAISense> SenseToFilterBy, TArray<AActor*>& OutActors) const;
38
39 UFUNCTION(BlueprintCallable, Category = "AI Tool Kit")
40 void GetPerceivedFriendlyActors(TArray<AActor*>& OutActors) const;
41 UFUNCTION(BlueprintCallable, Category = "AI Tool Kit")
42 void GetPerceivedFriendlyActorsBySense(const TSubclassOf<UAISense> SenseToUse, TArray<AActor*>& OutActors) const;
43
44 // UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
45 // bool IsFriendly(const FGenericTeamId& OwnerID, const TWeakObjectPtr<AActor> Target) const;
46 // UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
47 // bool IsNeutral(const TWeakObjectPtr<AActor> Target) const;
48
49 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
50 AAIController* GetOwnerController() const{return AIOwner;};
51
52 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
53 float GetMaxAge(const TSubclassOf<UAISense> SenseClass);
54 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
55 bool SetMaxAge(const TSubclassOf<UAISense> SenseClass, const float MaxAge);
56 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
57 bool SetSightMaxAge(const float MaxAge);
58 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Hearing")
59 bool SetHearingMaxAge(const float MaxAge);
60
61
62 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
63 float GetSightRange();
64 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
65 bool SetSightRange(const float SightRange);
66 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
67 float GetLoseSightRange();
68 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
69 bool SetLoseSightRange(const float LoseSightRange);
70 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
71 float GetVisionAngle();
72 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
73 bool SetVisionAngle(const float VisionAngle);
74 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
75 float GetAutoSuccessRange();
76 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
77 bool SetAutoSuccessRange(const float AutoSuccessRange);
78 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
79 float GetPOVBackwardOffset();
80 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
81 bool SetPOVBackwardOffset(const float POVBackwardOffset);
82 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
83 float GetNearClippingRadius();
84 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
85 bool SetNearClippingRadius(const float NearClippingRadius);
86 // UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
87 // void ShowSightVisionAngle(FGameplayDebuggerCategory* DebuggerCategory);
88 // UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Sight")
89 // void HideSightVisionAngle(FGameplayDebuggerCategory* DebuggerCategory);
90
91
92 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Hearing")
93 float GetHearingRange();
94 UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Hearing")
95 bool SetHearingRange(const float HearingRange);
96 //- pre 5.2 //
97 // UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Hearing")
98 // bool GetUseLoSHearing();
99 // UFUNCTION(BlueprintCallable, Category="AI Tool Kit|Hearing")
100 // bool SetUseLoSHearing(const bool UseLoSHearing);
101
102
103 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
104 FAISenseAffiliationFilter GetDetectionByAffiliation(const TSubclassOf<UAISense> SenseClass);
105
106
107 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
108 class UAISenseConfig_Sight* GetSightConfig();
109 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
110 class UAISenseConfig_Hearing* GetHearingConfig();
111 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
112 class UAISenseConfig_Actions* GetActionsConfig();
113 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
114 class UAISenseConfig_Damage* GetDamageConfig();
115 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
116 class UAISenseConfig_Prediction* GetPredictionConfig();
117 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
118 class UAISenseConfig_Team* GetTeamConfig();
119 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
120 class UAISenseConfig_Touch* GetTouchConfig();
121
122protected:
123 virtual void HandleExpiredStimulus(FAIStimulus& StimulusStore) override;
124
125 UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Forget Actor")
126 bool ForgetActorBP(AActor* ActorToForget);
127
128 UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Set Dominant Sense")
129 bool SetDominantSenseBP(const TSubclassOf<UAISense> SenseClass);
130 UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Get Dominant Sense")
131 TSubclassOf<UAISense> GetDominantSenseBP() const;
132
133
134 UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Get Body Actor")
135 const AActor* GetBodyActorBP() const;
136 UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Get Mutable Body Actor")
137 AActor* GetMutableBodyActorBP();
138 UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Get Location And Direction")
139 void GetLocationAndDirectionBP(FVector& Location, FVector& Direction) const;
140
141
142 //- Extras? //
143 UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Get Team Identifier")
144 FGenericTeamId GetTeamIdentifierBP() const;
145
146 // UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Get Actor Info")
147 // const FActorPerceptionInfo* GetActorInfoBP(const AActor* Actor) const;
148
149 // UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Get Freshest Trace")
150 // const FActorPerceptionInfo* GetFreshestTraceBP(const TSubclassOf<UAISense> SenseClass) const;
151
153 UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Update Perception Allow List")
154 void UpdatePerceptionAllowListBP(const TSubclassOf<UAISense> SenseClass, const bool bNewValue);
155
156 UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Get Youngest Stimulus Age")
157 float GetYoungestStimulusAgeBP(AActor* Source) const;
158 UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Has Any Active Stimulus")
159 bool HasAnyActiveStimulusBP(const AActor* Source) const;
160 UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Has Any Current Stimulus")
161 bool HasAnyCurrentStimulusBP(const AActor* Source) const;
162 UFUNCTION(BlueprintCallable, Category="AI Tool Kit", DisplayName="Has Active Stimulus")
163 bool HasActiveStimulusBP(const AActor* Source, const TSubclassOf<UAISense> SenseClass) const;
164
165
166#if WITH_GAMEPLAY_DEBUGGER_MENU
167 virtual void DescribeSelfToGameplayDebugger(FGameplayDebuggerCategory* DebuggerCategory) const override;
168#endif // WITH_GAMEPLAY_DEBUGGER_MENU
169
170
171
172};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnForgottenStimulus, FAIStimulus, Stimulus)
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition AISenseConfig_Actions.h:17
Definition AdvancedAIPerceptionComponent.h:15