Hi. I had to extend PathFollowingComponent so I created child
class TACTICAL_API UExtendedPathFollowingComponent : public UPathFollowingComponent
next I set it as
ANpcAIController::ANpcAIController() {
BehaviorTree = CreateDefaultSubobject<UBehaviorTree>(TEXT("BehaviorTree"));
BehaviorTreeComponent = CreateDefaultSubobject<UBehaviorTreeComponent>(TEXT("BehaviorTreeComponent"));
BlackboardComponent = CreateDefaultSubobject<UBlackboardComponent>(TEXT("UBlackboardComponent"));
auto TacticalPathFollowingComponent = CreateDefaultSubobject<UExtendedPathFollowingComponent>(TEXT("ExtendedPathFollowingComponent"));
SetPathFollowingComponent(TacticalPathFollowingComponent); //this line is cause of following crash
}
it works fine in editor, but when I try to run in Standalone mode I have following crash
UE4Editor_Engine!`anonymous namespace'::GetWorldForVisualLogger() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\VisualLogger\VisualLogger.cpp:44]
UE4Editor_Engine!FVisualLogger::GetRedirectionMap() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\VisualLogger\VisualLogger.cpp:467]
UE4Editor_Engine!FVisualLogger::Redirect() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\VisualLogger\VisualLogger.cpp:486]
UE4Editor_AIModule!AAIController::SetPathFollowingComponent() [D:\Build\++UE4\Sync\Engine\Source\Runtime\AIModule\Private\AIController.cpp:1094]
UE4Editor_Tactical_Win64_DebugGame!ANpcAIController::ANpcAIController() [D:\Games\Tactical\Source\Tactical\AI\NpcAIController.cpp:15]
core AIController.cpp:1094 seems like
void AAIController::SetPathFollowingComponent(UPathFollowingComponent* NewPFComponent)
{
PathFollowingComponent = NewPFComponent;
#if ENABLE_VISUAL_LOG
if (NewPFComponent)
{
REDIRECT_OBJECT_TO_VLOG(NewPFComponent, this);
}
#endif // ENABLE_VISUAL_LOG
}
I have no clue how can I fix it. I don’t want to disable ENABLE_VISUAL_LOG. I have not used it yet, but I’ve red it’s usefull feature. What have I missed?
Thanks!