How to initialize a C++ Blackboard

Kabe
Tue, 03 Jan 2017 00:56:32 +0000
AI

I am building an C++ based AIController, and I would like to use the Blackboard but not linked with a BehaviorTree.

So, on the constructor of the controller I create the blackboard:

BlackboardComponent = CreateDefaultSubobject<UBlackboardComponent>(TEXT("BlackboardComponent"));

and normally on the override of the Possess(APawn* pawn) method

BlackboardComponent->InitializeBlackboard(*(character->BehaviorTree->BlackboardAsset));
BlackboardComponent->SetValueAsObject(TargetKey, character->FirstNode);
BehaviorTreeComponent->StartTree(*(character->BehaviorTree));

But, since I don’t want to use the behavior tree, I can not figure out how to initialize or setup the blackboard from C++.

BlackboardComponent->InitializeBlackboard( **???** );
BlackboardComponent->SetValueAsObject("Target", character->FirstNode);

Thanks in advance,

4 posts - 3 participants