diff --git a/Content/BlueprintAI/AI/AIControllerBruh.uasset b/Content/BlueprintAI/AI/AIControllerBruh.uasset index 80d88e1..9737754 100644 --- a/Content/BlueprintAI/AI/AIControllerBruh.uasset +++ b/Content/BlueprintAI/AI/AIControllerBruh.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b3bf037902c2aa1ed7ada853c5c16a27b948ee58bab4fec7dfc395a7003cd94c -size 97758 +oid sha256:c5fd648c575abc38b53e4d6f99f64a879b19c0672c2fa6a97e77cea008fad1dd +size 98856 diff --git a/Content/Blueprints/Combat_UI/CombatCharacter.uasset b/Content/Blueprints/Combat_UI/CombatCharacter.uasset index 6078475..c49d3cd 100644 --- a/Content/Blueprints/Combat_UI/CombatCharacter.uasset +++ b/Content/Blueprints/Combat_UI/CombatCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:53c111471c3a161fb4ed5408ebeac5cfca08d224652308dbb07cac6d7b829d6b -size 76303 +oid sha256:e7b65b297ddbb306a093e271695635dfbaa96bb5a1f3c6fd0ce26ecd774a48e5 +size 71609 diff --git a/Content/Blueprints/Player/BP_MyTempCharacter.uasset b/Content/Blueprints/Player/BP_MyTempCharacter.uasset index b161173..3667ddf 100644 --- a/Content/Blueprints/Player/BP_MyTempCharacter.uasset +++ b/Content/Blueprints/Player/BP_MyTempCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8e348a27c5a931226dba531ec739fec1e28b9f912e91b46078ed811fe50f06bd -size 54956 +oid sha256:f2a39b15f6e64703046d9cb9b437b04838acc10eb1f1465c94bd6d8b2c4395ed +size 55131 diff --git a/Content/Levels/Testing/SneakMechanicTesting.umap b/Content/Levels/Testing/SneakMechanicTesting.umap new file mode 100644 index 0000000..e2cea40 --- /dev/null +++ b/Content/Levels/Testing/SneakMechanicTesting.umap @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d44e1d44549e6cd4deb70fd46d4a804ad1ca3081b495b51f9258da3d741d6ab6 +size 36264 diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index 6710218..3b8e8c0 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -36,11 +36,13 @@ void ATempCharacter::BeginPlay() //MAKE SURE POST PROCESSING IS IN THE SCENE OR GAME WILL CRASH UGameplayStatics::GetAllActorsOfClass(GetWorld(), APostProcessVolume::StaticClass(), AllActorsInScene); - PostProcessVolume = Cast(AllActorsInScene[0]); - Enemy = TEXT("Enemy"); UGameplayStatics::GetAllActorsWithTag(GetWorld(), Enemy, AIActors); - + //stops crashing + if (ensureMsgf(AllActorsInScene.Num() > 0, TEXT("No Post Processing Volume in scene"))) + { + PostProcessVolume = Cast(AllActorsInScene[0]); + } Ammo = TEXT("Ammo"); } @@ -61,14 +63,11 @@ void ATempCharacter::Sneak() if (bIsCrouched) { UnCrouch(); - PostProcessVolume->Settings.VignetteIntensity = 0.0f; + if (PostProcessVolume != nullptr) PostProcessVolume->Settings.VignetteIntensity = 0.0f; for (AActor* Actor : AIActors) { USphereComponent* SphereComponent = Actor->FindComponentByClass(); - if (SphereComponent != nullptr) - { - SphereComponent->SetSphereRadius(40.0f); //default value - } + if (SphereComponent != nullptr) SphereComponent->SetSphereRadius(40.0f); //default value } } else @@ -77,12 +76,9 @@ void ATempCharacter::Sneak() for (AActor* Actor : AIActors) { USphereComponent* SphereComponent = Actor->FindComponentByClass(); - if (SphereComponent != nullptr) - { - SphereComponent->SetSphereRadius(15.0f); - } + if (SphereComponent != nullptr) SphereComponent->SetSphereRadius(15.0f); } - PostProcessVolume->Settings.VignetteIntensity = 0.8f; + if (PostProcessVolume != nullptr) PostProcessVolume->Settings.VignetteIntensity = 0.8f; } } @@ -140,7 +136,6 @@ void ATempCharacter::LineTraceLogic() } if(OutHit.GetActor()->FindComponentByClass()) { - UE_LOG(LogTemp, Display, TEXT("Hit Merchant")); auto ItemArray = OutHit.GetActor()->FindComponentByClass()->GetItem(0); if(GoldBalance >= ItemArray->ItemCostPrice) { @@ -150,10 +145,11 @@ void ATempCharacter::LineTraceLogic() } if(GoldBalance <= 0) { - UE_LOG(LogTemp, Display, TEXT("Not Enough Gold")); + return; } if(OutHit.GetActor()->ActorHasTag(Ammo)) { + UE_LOG(LogTemp, Display, TEXT("Ammo destroy func activated")); OutHit.GetActor()->Destroy(); } } @@ -163,7 +159,6 @@ void ATempCharacter::LineTraceLogic() { if (MyInteractable->ShopDialogWidget->IsVisible()) { - UE_LOG(LogTemp, Display, TEXT("ShopKeeper text is visible")); bShopKeeperText = true; return; } @@ -178,7 +173,6 @@ void ATempCharacter::LineTraceLogic() { DrawDebugLine(GetWorld(), Start, End, FColor::Green, false, 1.0f); MyInteractable->OnInteract(); - UE_LOG(LogTemp, Display, TEXT("OnInteract activated")); UE_LOG(LogTemp, Display, TEXT("HIT: %s"), *OutHit.GetActor()->GetName()); // While loop to check bisDisabled var until it changes to true