Advertisement
orfeasel

AI Controller Header file

Dec 31st, 2015
21,445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1.     /*Behavior tree comp ref*/
  2.     UBehaviorTreeComponent* BehaviorComp;
  3.    
  4.     /*----------Blackboard----------*/
  5.  
  6.     /*Blackboard comp ref*/
  7.     UBlackboardComponent* BlackboardComp;
  8.  
  9.     /*Blackboard keys*/
  10.     UPROPERTY(EditDefaultsOnly, Category = "AI")
  11.     FName LocationToGoKey;
  12.  
  13.     /*----------Blackboard----------*/
  14.  
  15.     /*I use the AActor class as the Template class so I can use the GetAllActorsOfClass function.
  16.     However, in this collection I'm going to store all the Available ABotTargetPoint instances.*/
  17.     TArray<AActor*> BotTargetPoints;
  18.  
  19.     /*Posses is executed when the character we want to control is spawned.
  20.     Inside this function, we initialize the blackboard and start the behavior tree*/
  21.     virtual void Possess(APawn* Pawn) override;
  22.  
  23. public:
  24.  
  25.     /*----------Constructor----------*/
  26.     AMyAIController();
  27.  
  28.     FORCEINLINE UBlackboardComponent* GetBlackboardComp() const { return BlackboardComp; }
  29.  
  30.     FORCEINLINE TArray<AActor*> GetAvailableTargetPoints() { return BotTargetPoints; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement