diff --git a/Content/AI/BT_UHL_GameplayFocus.uasset b/Content/AI/BT_UHL_GameplayFocus.uasset index 724736a..1f70db5 100644 Binary files a/Content/AI/BT_UHL_GameplayFocus.uasset and b/Content/AI/BT_UHL_GameplayFocus.uasset differ diff --git a/Content/AI/BT_UHL_InAngle.uasset b/Content/AI/BT_UHL_InAngle.uasset index 355ebd3..7651df2 100644 Binary files a/Content/AI/BT_UHL_InAngle.uasset and b/Content/AI/BT_UHL_InAngle.uasset differ diff --git a/Content/AI/BT_UHL_InRange.uasset b/Content/AI/BT_UHL_InRange.uasset index 8c37277..6cbc586 100644 Binary files a/Content/AI/BT_UHL_InRange.uasset and b/Content/AI/BT_UHL_InRange.uasset differ diff --git a/Content/AI/BT_UHL_InvokeGameplayAbility.uasset b/Content/AI/BT_UHL_InvokeGameplayAbility.uasset index d468203..d756078 100644 Binary files a/Content/AI/BT_UHL_InvokeGameplayAbility.uasset and b/Content/AI/BT_UHL_InvokeGameplayAbility.uasset differ diff --git a/Content/AI/BT_UHL_PlayAnimMontage.uasset b/Content/AI/BT_UHL_PlayAnimMontage.uasset index 8155b3c..f8d725a 100644 Binary files a/Content/AI/BT_UHL_PlayAnimMontage.uasset and b/Content/AI/BT_UHL_PlayAnimMontage.uasset differ diff --git a/Content/AI/BT_UHL_RandomChance.uasset b/Content/AI/BT_UHL_RandomChance.uasset index 4693075..e141a2f 100644 Binary files a/Content/AI/BT_UHL_RandomChance.uasset and b/Content/AI/BT_UHL_RandomChance.uasset differ diff --git a/Content/AI/BT_UHL_RandomLoop.uasset b/Content/AI/BT_UHL_RandomLoop.uasset index 2e69954..89b5b41 100644 Binary files a/Content/AI/BT_UHL_RandomLoop.uasset and b/Content/AI/BT_UHL_RandomLoop.uasset differ diff --git a/Content/AI/BT_UHL_RandomSelector.uasset b/Content/AI/BT_UHL_RandomSelector.uasset index c9536f4..e7f48c0 100644 Binary files a/Content/AI/BT_UHL_RandomSelector.uasset and b/Content/AI/BT_UHL_RandomSelector.uasset differ diff --git a/Content/AI/BT_UHL_RandomTimelimit.uasset b/Content/AI/BT_UHL_RandomTimelimit.uasset index e1481a4..af12585 100644 Binary files a/Content/AI/BT_UHL_RandomTimelimit.uasset and b/Content/AI/BT_UHL_RandomTimelimit.uasset differ diff --git a/Content/AI/BT_UHL_SetBBValue.uasset b/Content/AI/BT_UHL_SetBBValue.uasset index 640d787..8908528 100644 Binary files a/Content/AI/BT_UHL_SetBBValue.uasset and b/Content/AI/BT_UHL_SetBBValue.uasset differ diff --git a/Content/Gyms/Gym_AI.umap b/Content/Gyms/Gym_AI.umap index 601f016..986a0ea 100644 Binary files a/Content/Gyms/Gym_AI.umap and b/Content/Gyms/Gym_AI.umap differ diff --git a/README.md b/README.md index 236e253..49e4e0a 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ From source: > - Components > - [AbilitySystemComponent](#abilitysystemcomponent) > - Tasks -> - [InterpolateToPosition](interpolatetoposition) +> - [InterpolateToPosition](#interpolatetoposition) > - [AI](#ai) > - Components > - [AIPerceptionComponent](#uhlaiperceptioncomponent) @@ -181,10 +181,12 @@ Requirements: - turn on `UseControllerDesiredRotation` - turn off + - `bOrientRotationToMovement` - `UseControllerRotationYaw` - `UseControllerRotationPitch` - `UseControllerRotationRoll` + Troubleshooting: - check that nothing "ClearFocus" diff --git a/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_InRange.cpp b/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_InRange.cpp index bc30b46..cee649e 100644 --- a/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_InRange.cpp +++ b/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_InRange.cpp @@ -104,7 +104,7 @@ float UBTD_InRange::GetCurrentDistance(const UBehaviorTreeComponent& OwnerComp, DrawDebugLine(OwnerComp.GetWorld(), LineStart, LineEnd, bInRange ? FColor::Green : FColor::Red, false, DebugLifetime, -1, 2.0f); DrawDebugSphere(OwnerComp.GetWorld(), LineStart, 5.0f, 16, FColor::Blue, false, DebugLifetime, DebugLifetime, 2.0f); DrawDebugSphere(OwnerComp.GetWorld(), LineEnd, 5.0f, 16, FColor::Blue, false, DebugLifetime, DebugLifetime, 2.0f); - DrawDebugString(OwnerComp.GetWorld(), TextLocation, FString::Printf(TEXT("Distance: %.2f"), CurrentDistance), nullptr, FColor::White, DebugLifetime < 0 ? 0 : DebugLifetime, true); + DrawDebugString(OwnerComp.GetWorld(), TextLocation, FString::Printf(TEXT("Distance: %.2f"), CurrentDistance), nullptr, bInRange ? FColor::Green : FColor::Red, DebugLifetime < 0 ? 0 : DebugLifetime, true); DrawDebugString(OwnerComp.GetWorld(), OwnerCharacter->GetActorLocation(), FString::Printf(TEXT("ParentNode:\n%s \n\nNodeName:\n%s"), *GetParentNode()->NodeName, *GetMyNode()->NodeName), nullptr, FColor::White, DebugLifetime < 0 ? 0 : DebugLifetime, true); } diff --git a/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_RandomChance.cpp b/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_RandomChance.cpp index 76ac901..9c9c9ce 100644 --- a/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_RandomChance.cpp +++ b/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_RandomChance.cpp @@ -14,32 +14,34 @@ UBTD_RandomChance::UBTD_RandomChance(const FObjectInitializer& ObjectInitializer bAllowAbortLowerPri = false; bAllowAbortChildNodes = false; - ChanceInBB.AddFloatFilter(this, GET_MEMBER_NAME_CHECKED(UBTD_RandomChance, ChanceInBB)); + // TODO value from blackboard + // ChanceInBB.AddFloatFilter(this, GET_MEMBER_NAME_CHECKED(UBTD_RandomChance, ChanceInBB)); } bool UBTD_RandomChance::CalculateRawConditionValue(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) const { float CurrentChance = 0.0f; - if (bUseBlackboardValue) - { - CurrentChance = FMath::Clamp(OwnerComp.GetBlackboardComponent()->GetValueAsFloat(ChanceInBB.SelectedKeyName), 0.0f, 1.0f); - } + // TODO value from blackboard + // if (bUseBlackboardValue) + // { + // CurrentChance = FMath::Clamp(OwnerComp.GetBlackboardComponent()->GetValueAsFloat(ChanceInBB.SelectedKeyName), 0.0f, 1.0f); + // } // else if (bUseUnclamped) // { // CurrentChance = ChanceUnclamped // } - else - { + // else + // { CurrentChance = Chance; - } + // } return UKismetMathLibrary::RandomBoolWithWeight(CurrentChance); } FString UBTD_RandomChance::GetStaticDescription() const { - // TODO BB value preview? - // float CurrentChance = bUseBlackboardValue ? GetBlackboardAsset()->GetKey(ChanceInBB.GetSelectedKeyID()) : Chance; + // TODO BB value preview? + // float CurrentChance = bUseBlackboardValue ? GetBlackboardAsset()->GetKey(ChanceInBB.GetSelectedKeyID()) : Chance; return FString::Printf(TEXT("Chance - %.2f%% (%.2f)"), Chance * 100.0f, Chance); } diff --git a/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_RandomChance.h b/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_RandomChance.h index b866011..1b59bbd 100644 --- a/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_RandomChance.h +++ b/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_RandomChance.h @@ -21,13 +21,15 @@ class UNREALHELPERLIBRARY_API UBTD_RandomChance : public UBTDecorator float Chance; // UPROPERTY(Category=Decorator, EditAnywhere, meta=(EditCondition="bUseUnclamped && !bUseBlackboardValue", EditConditionHides)) // float ChanceUnclamped; - UPROPERTY(Category=Decorator, EditAnywhere, meta=(EditCondition="bUseBlackboardValue", EditConditionHides)) - FBlackboardKeySelector ChanceInBB; + // TODO value from blackboard + // UPROPERTY(Category=Decorator, EditAnywhere, meta=(EditCondition="bUseBlackboardValue", EditConditionHides)) + // FBlackboardKeySelector ChanceInBB; // UPROPERTY(Category=Decorator, EditAnywhere) // bool bUseUnclamped = false; - UPROPERTY(Category=Decorator, EditAnywhere) - bool bUseBlackboardValue = false; + // TODO value from blackboard + // UPROPERTY(Category=Decorator, EditAnywhere) + // bool bUseBlackboardValue = false; virtual bool CalculateRawConditionValue(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) const override;