From 655803fb18b4c85740d9391b356b9ea072419f86 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 12:55:53 +0000 Subject: [PATCH 01/20] Fixed Testing level crashing --- .../Levels/DoorTestLevel/0/24/JBARER4CBJ0QZT5CZY8ID6.uasset | 3 --- .../Levels/DoorTestLevel/2/K1/58MA6LCG9V3BWWEPHFBLQO.uasset | 3 +++ .../Levels/DoorTestLevel/9/V5/00HOTT7GJB6N5M6TZHPJO5.uasset | 3 --- .../Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/0/24/JBARER4CBJ0QZT5CZY8ID6.uasset create mode 100644 EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/2/K1/58MA6LCG9V3BWWEPHFBLQO.uasset delete mode 100644 EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/V5/00HOTT7GJB6N5M6TZHPJO5.uasset diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/0/24/JBARER4CBJ0QZT5CZY8ID6.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/0/24/JBARER4CBJ0QZT5CZY8ID6.uasset deleted file mode 100644 index cc218a93..00000000 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/0/24/JBARER4CBJ0QZT5CZY8ID6.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:624574d06d0678bdb53ec083c7b9635e45021665db71193cdbbd1c149026a7ba -size 6519 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/2/K1/58MA6LCG9V3BWWEPHFBLQO.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/2/K1/58MA6LCG9V3BWWEPHFBLQO.uasset new file mode 100644 index 00000000..5ad45d46 --- /dev/null +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/2/K1/58MA6LCG9V3BWWEPHFBLQO.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf90068af9ba236bf3b3aac0f65d70eced4c12c6b814b4acbf9e816b4fdd14ce +size 7960 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/V5/00HOTT7GJB6N5M6TZHPJO5.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/V5/00HOTT7GJB6N5M6TZHPJO5.uasset deleted file mode 100644 index f35d5c73..00000000 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/V5/00HOTT7GJB6N5M6TZHPJO5.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:227182e3c4bf297a0f312798841c02a738f6cf738d30d574a85f837401023418 -size 6609 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset index 5884c860..97227d02 100644 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a01b69854d463092b0ca667e7b38400f45d77bc28a442d80e1ad7629d26507c5 +oid sha256:58b8823622d837826bc46ebf642ee79cbd8db842b98245e6bb40023105787fa6 size 6374 From 1bb93785175dab405aaa5be9d7b0ac2d5ac5f9f6 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 12:56:05 +0000 Subject: [PATCH 02/20] Fixed workbench not working with new pistol --- .../Workbench_UI/WBP_Workbench.uasset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset index f7d9ff1f..9ed57331 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:453fcd2051bb7162a4c54dccd78d1c02603a9c11ab43a18146451d41d776862c -size 309217 +oid sha256:58d033942dbcf3d4dc46df1315c5381ba60ef821ce7cdcd01660304a7d108356 +size 307087 From 61082c2b7773bbd92718f35d2884a0dd05598222 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 12:56:15 +0000 Subject: [PATCH 03/20] Fixed workbench not working with new pistol code --- .../Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset index e0b19392..f7658767 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4a985ecacf144a27ded607dd2012889e01421cc0050d1278ca36a169872cf899 -size 149685 +oid sha256:2d099a2a0950b5c1c4ac553c41cf946cbc1067c103b118c8559b58b6574a29f8 +size 148769 From 397ed93c3147ea8901329caa772d173cbc8899a0 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 12:56:36 +0000 Subject: [PATCH 04/20] Fixed New pistol not having needed stuff for attachments --- .../AnimatedPistol/BP_BasePistolWeapon_Animated.uasset | 4 ++-- .../BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset | 4 ++-- .../BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset | 4 ++-- EndlessVendetta/Content/Levels/DoorTestLevel.umap | 4 ++-- EndlessVendetta/EndlessVendetta.sln.DotSettings.user | 2 -- 5 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 EndlessVendetta/EndlessVendetta.sln.DotSettings.user diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset index 1984e416..ccc2ed32 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4d525f0bed0d08486856e1144f795a8cdd6f0b1e85e9a01ef0bbb4b031f664af -size 252383 +oid sha256:205e8a18116f736714205b9148256ad96810ffeb84ea16a491b783bf989c17b1 +size 254152 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset index a7b68978..8ffd811b 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:46a72a6671c239098b2d0ebfa2e2af9fbfb8bb7b53d39fb723db61c91a0477bd -size 935377 +oid sha256:7da9836d8effa97690f454265454ec8a25ab42d399735553634e8d83517c08be +size 935428 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset index 3aa488b7..04d9113a 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b7e0480b2ff1c91c0099c9d4a03590743360d8d139a4e103154e2be11856cf8d -size 7647 +oid sha256:a42f7432ef2dcd4b72bcb277bc81d5dfb89eb0c02c645f3be1433b1e645e5a76 +size 8166 diff --git a/EndlessVendetta/Content/Levels/DoorTestLevel.umap b/EndlessVendetta/Content/Levels/DoorTestLevel.umap index 4421c400..09bc9382 100644 --- a/EndlessVendetta/Content/Levels/DoorTestLevel.umap +++ b/EndlessVendetta/Content/Levels/DoorTestLevel.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d2943d11286f0fe5199956829c50f4c143255de490d6854d443df6956b6aaed9 -size 19237 +oid sha256:df1aa3a4181f8c693ffe2f2f152cde6f60f1f28dd691cfd35de34c6837fbe35f +size 19500 diff --git a/EndlessVendetta/EndlessVendetta.sln.DotSettings.user b/EndlessVendetta/EndlessVendetta.sln.DotSettings.user deleted file mode 100644 index 2b08f3a1..00000000 --- a/EndlessVendetta/EndlessVendetta.sln.DotSettings.user +++ /dev/null @@ -1,2 +0,0 @@ - - C:\Users\Rafal\AppData\Local\JetBrains\Rider2023.3\resharper-host\temp\Rider\vAny\CoverageData\_EndlessVendetta.-1253833435\Snapshot\snapshot.utdcvr \ No newline at end of file From 28d6f400ef43391461c6d09fd1991a93ae41ad9f Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 13:12:00 +0000 Subject: [PATCH 05/20] Created Extended Mag attachment class --- .../ExtendedMagAttachmentClass.cpp | 35 +++++++++++++++++++ .../ExtendedMagAttachmentClass.h | 0 2 files changed, 35 insertions(+) create mode 100644 EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp create mode 100644 EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp new file mode 100644 index 00000000..945c675a --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp @@ -0,0 +1,35 @@ +$COPYRIGHT_LINE$ + + +$MY_HEADER_INCLUDE_DIRECTIVE$ + + +// Sets default values for this component's properties +$PREFIX$$UNPREFIXED_CLASS_NAME$::$PREFIX$$UNPREFIXED_CLASS_NAME$() +{ + // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features + // off to improve performance if you don't need them. + PrimaryComponentTick.bCanEverTick = true; + + // ... +} + + +// Called when the game starts +void $PREFIX$$UNPREFIXED_CLASS_NAME$::BeginPlay() +{ + Super::BeginPlay(); + + // ... + $END$ +} + + +// Called every frame +void $PREFIX$$UNPREFIXED_CLASS_NAME$::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) +{ + Super::TickComponent(DeltaTime, TickType, ThisTickFunction); + + // ... +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h new file mode 100644 index 00000000..e69de29b From 1cf66a77731ecfd58c7f8b3ecdd571bfb8898b91 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 13:12:16 +0000 Subject: [PATCH 06/20] Added ExtendedMag socket point for pistol weapon --- .../BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset | 2 +- .../BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset index 8ffd811b..cce46cd1 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7da9836d8effa97690f454265454ec8a25ab42d399735553634e8d83517c08be +oid sha256:58a33e2324ddbad7a46a724973e6a52b0df8dac6bc4c53f2260d16829e9e6ccd size 935428 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset index 04d9113a..dc4c73de 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a42f7432ef2dcd4b72bcb277bc81d5dfb89eb0c02c645f3be1433b1e645e5a76 -size 8166 +oid sha256:b371d4e51da854075a493ce08aca665dde7f02466f2010f05d652f15a6624337 +size 8451 From e2eb32653e0619294146994f504286e28267c8c2 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 13:12:37 +0000 Subject: [PATCH 07/20] Created ExtendedMag attachment code to baseweapon class --- .../WeaponSystem/BaseWeaponClass.cpp | 44 +++++++++++++++++++ .../WeaponSystem/BaseWeaponClass.h | 6 +++ .../ExtendedMagAttachmentClass.cpp | 12 ++--- .../ExtendedMagAttachmentClass.h | 26 +++++++++++ 4 files changed, 82 insertions(+), 6 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp index c3266efb..8609bbc9 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp @@ -278,6 +278,7 @@ void ABaseWeaponClass::InteractPrompt() WeaponStatsPopUp(); } +//Called in weaponworkbench WBP void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh) { GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("SETTING UP SILENCER ATTACHMENTS")); @@ -290,11 +291,13 @@ void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh) { if (IsValid(WeaponSkeletonMesh)) { + //this handles giving the weapon the required component class/code SilencerAttachmentClass->AttachToComponent(WeaponSkeletonMesh, FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("SilencerMeshSocket"))); UE_LOG(LogTemp, Display, TEXT("All Attachment is valid")); //this makes it showup in editor for better debugging SilencerAttachmentClass->CreationMethod = EComponentCreationMethod::Instance; SilencerAttachmentClass->RegisterComponent(); + //below handles seeing the physical attachment you selected UStaticMeshComponent* StaticMeshComp = NewObject(SilencerAttachmentClass, UStaticMeshComponent::StaticClass()); if (IsValid(StaticMeshComp)) { @@ -309,3 +312,44 @@ void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh) } } } + +//Called in weaponworkbench WBP +void ABaseWeaponClass::SetupExtendedMagAttachment(UStaticMesh* ExtendedMagMesh) +{ + GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("SETTING UP EXTENDEDMAG ATTACHMENTS")); + FTransform EmptyTransform; + + USceneComponent* ExtendedMagAttachmentClass = Cast(AddComponentByClass(USilencerAttachmentClass::StaticClass(), false, EmptyTransform, false)); + ExtendedMagAttachmentClass->ComponentTags.Add(FName("AttachmentType")); + USkeletalMeshComponent* WeaponSkeletonMesh = FindComponentByClass(); + if (IsValid(ExtendedMagAttachmentClass)) + { + if (IsValid(WeaponSkeletonMesh)) + { + //this handles giving the weapon the required component class/code + ExtendedMagAttachmentClass->AttachToComponent(WeaponSkeletonMesh, FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("SilencerMeshSocket"))); + UE_LOG(LogTemp, Display, TEXT("All Attachment is valid")); + //this makes it showup in editor for better debugging + ExtendedMagAttachmentClass->CreationMethod = EComponentCreationMethod::Instance; + ExtendedMagAttachmentClass->RegisterComponent(); + //below handles seeing the physical attachment you selected + UStaticMeshComponent* StaticMeshComp = NewObject(ExtendedMagAttachmentClass, UStaticMeshComponent::StaticClass()); + if (IsValid(StaticMeshComp)) + { + StaticMeshComp->AttachToComponent(ExtendedMagAttachmentClass, FAttachmentTransformRules::SnapToTargetIncludingScale); + StaticMeshComp->SetStaticMesh(ExtendedMagMesh); + StaticMeshComp->SetRelativeRotation(FRotator(0, 90, 0)); + StaticMeshComp->SetCollisionEnabled(ECollisionEnabled::NoCollision); + //Making it show in editor for debugging + StaticMeshComp->CreationMethod = EComponentCreationMethod::Instance; + StaticMeshComp->RegisterComponent(); + } + } + } +} + +//Called in weaponworkbench WBP +void ABaseWeaponClass::SetupGripAttachment(UStaticMesh* GripMesh) +{ + +} diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h index d934ea9e..3d6a0635 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h @@ -175,6 +175,12 @@ public: UFUNCTION(BlueprintCallable) void SetupSilencerAttachment(UStaticMesh* SilencerMesh); + UFUNCTION(BlueprintCallable) + void SetupExtendedMagAttachment(UStaticMesh* ExtendedMagMesh); + + UFUNCTION(BlueprintCallable) + void SetupGripAttachment(UStaticMesh* GripMesh); + UFUNCTION(BlueprintImplementableEvent) void ShowReloadingWidget(); diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp index 945c675a..ea2321ae 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp @@ -1,11 +1,11 @@ -$COPYRIGHT_LINE$ +// Fill out your copyright notice in the Description page of Project Settings. -$MY_HEADER_INCLUDE_DIRECTIVE$ +#include "ExtendedMagAttachmentClass.h" // Sets default values for this component's properties -$PREFIX$$UNPREFIXED_CLASS_NAME$::$PREFIX$$UNPREFIXED_CLASS_NAME$() +UExtendedMagAttachmentClass::UExtendedMagAttachmentClass() { // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features // off to improve performance if you don't need them. @@ -16,17 +16,17 @@ $PREFIX$$UNPREFIXED_CLASS_NAME$::$PREFIX$$UNPREFIXED_CLASS_NAME$() // Called when the game starts -void $PREFIX$$UNPREFIXED_CLASS_NAME$::BeginPlay() +void UExtendedMagAttachmentClass::BeginPlay() { Super::BeginPlay(); // ... - $END$ + } // Called every frame -void $PREFIX$$UNPREFIXED_CLASS_NAME$::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) +void UExtendedMagAttachmentClass::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h index e69de29b..f2dddee9 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h @@ -0,0 +1,26 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Components/SceneComponent.h" +#include "ExtendedMagAttachmentClass.generated.h" + + +UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent)) +class ENDLESSVENDETTA_API UExtendedMagAttachmentClass : public USceneComponent +{ + GENERATED_BODY() + +public: + // Sets default values for this component's properties + UExtendedMagAttachmentClass(); + +protected: + // Called when the game starts + virtual void BeginPlay() override; + +public: + // Called every frame + virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; +}; From 68172acedef2b64301d7bf85d857d4d4ccb33e14 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 13:49:17 +0000 Subject: [PATCH 08/20] Positioned and Scaled ExtendedMag attachment --- .../BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset | 4 ++-- .../BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset index cce46cd1..1a83bc87 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:58a33e2324ddbad7a46a724973e6a52b0df8dac6bc4c53f2260d16829e9e6ccd -size 935428 +oid sha256:ff6c8aa8880a4d1f557b45ac935694bee0ba143340e0b9766cc36c38990ebbbf +size 935300 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset index dc4c73de..fa85464f 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b371d4e51da854075a493ce08aca665dde7f02466f2010f05d652f15a6624337 -size 8451 +oid sha256:afed2c18556d8421ea8fcb38eca1f21b21c2e7549c757f4da861c91c1b66cd25 +size 8514 From dd4cb95d1c989274cf0b609a84c60e89320f6760 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 13:51:13 +0000 Subject: [PATCH 09/20] Created ExtendedMag option in workbench --- .../Workbench_UI/WBP_Workbench.uasset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset index 9ed57331..2044d6bc 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:58d033942dbcf3d4dc46df1315c5381ba60ef821ce7cdcd01660304a7d108356 -size 307087 +oid sha256:112dde2da9210c007677c07871a05c2cb378b46f8f4f95b5b0dd0dd3fde5a271 +size 384174 From cd8f414b037ae6e8a3d70a4b9db981dd972ba990 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 13:51:30 +0000 Subject: [PATCH 10/20] Fixed extended mag attachement code not working --- .../Content/StarterContent/Shapes/TempExtendedMag.uasset | 3 +++ .../EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp | 7 ++++--- .../Workbench&Attachments/ExtendedMagAttachmentClass.cpp | 2 -- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 EndlessVendetta/Content/StarterContent/Shapes/TempExtendedMag.uasset diff --git a/EndlessVendetta/Content/StarterContent/Shapes/TempExtendedMag.uasset b/EndlessVendetta/Content/StarterContent/Shapes/TempExtendedMag.uasset new file mode 100644 index 00000000..ab1b9cd1 --- /dev/null +++ b/EndlessVendetta/Content/StarterContent/Shapes/TempExtendedMag.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dad1cb27145affe784da5f1db42f9979fd90bec8ab16c70049273f58cabfb210 +size 47919 diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp index 8609bbc9..dc15bb2e 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp @@ -13,6 +13,7 @@ #include #include "EndlessVendetta/BountySystem/ControlsTraining/TargetDummy.h" +#include "EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h" #include "EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.h" @@ -319,7 +320,7 @@ void ABaseWeaponClass::SetupExtendedMagAttachment(UStaticMesh* ExtendedMagMesh) GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("SETTING UP EXTENDEDMAG ATTACHMENTS")); FTransform EmptyTransform; - USceneComponent* ExtendedMagAttachmentClass = Cast(AddComponentByClass(USilencerAttachmentClass::StaticClass(), false, EmptyTransform, false)); + USceneComponent* ExtendedMagAttachmentClass = Cast(AddComponentByClass(UExtendedMagAttachmentClass::StaticClass(), false, EmptyTransform, false)); ExtendedMagAttachmentClass->ComponentTags.Add(FName("AttachmentType")); USkeletalMeshComponent* WeaponSkeletonMesh = FindComponentByClass(); if (IsValid(ExtendedMagAttachmentClass)) @@ -327,7 +328,7 @@ void ABaseWeaponClass::SetupExtendedMagAttachment(UStaticMesh* ExtendedMagMesh) if (IsValid(WeaponSkeletonMesh)) { //this handles giving the weapon the required component class/code - ExtendedMagAttachmentClass->AttachToComponent(WeaponSkeletonMesh, FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("SilencerMeshSocket"))); + ExtendedMagAttachmentClass->AttachToComponent(WeaponSkeletonMesh, FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("ExtendedMagSocket"))); UE_LOG(LogTemp, Display, TEXT("All Attachment is valid")); //this makes it showup in editor for better debugging ExtendedMagAttachmentClass->CreationMethod = EComponentCreationMethod::Instance; @@ -338,7 +339,7 @@ void ABaseWeaponClass::SetupExtendedMagAttachment(UStaticMesh* ExtendedMagMesh) { StaticMeshComp->AttachToComponent(ExtendedMagAttachmentClass, FAttachmentTransformRules::SnapToTargetIncludingScale); StaticMeshComp->SetStaticMesh(ExtendedMagMesh); - StaticMeshComp->SetRelativeRotation(FRotator(0, 90, 0)); + StaticMeshComp->SetRelativeRotation(FRotator(0, 180, 0)); StaticMeshComp->SetCollisionEnabled(ECollisionEnabled::NoCollision); //Making it show in editor for debugging StaticMeshComp->CreationMethod = EComponentCreationMethod::Instance; diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp index ea2321ae..a571842b 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp @@ -29,7 +29,5 @@ void UExtendedMagAttachmentClass::BeginPlay() void UExtendedMagAttachmentClass::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); - - // ... } From abee971d6b472c748ed763b01b02bc7dec3eecb9 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 15:15:56 +0000 Subject: [PATCH 11/20] Changed workbench code to allow certain attachments on certain weapons --- .../BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset | 2 +- .../BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset | 2 +- .../Workbench_UI/WBP_Workbench.uasset | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset index 1a83bc87..94d5738d 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ff6c8aa8880a4d1f557b45ac935694bee0ba143340e0b9766cc36c38990ebbbf +oid sha256:8aad6513dafb2daf9c77cc9ffedead792f7ee4e22709ca20309d967f64ee1e7b size 935300 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset index fa85464f..95dbec74 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:afed2c18556d8421ea8fcb38eca1f21b21c2e7549c757f4da861c91c1b66cd25 +oid sha256:42e8aa4a97d3707f88fbe1ada9b9abc4e0de881fc65bcfb759a46e39db613550 size 8514 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset index 2044d6bc..a5661453 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:112dde2da9210c007677c07871a05c2cb378b46f8f4f95b5b0dd0dd3fde5a271 -size 384174 +oid sha256:c3646f88205f249df2cae1cf3f15ced54950f74f77e1ef5a7cd387fb36b65f41 +size 396176 From 2542404a4f36354934b63be8b2b99b47c78f7052 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 15:16:06 +0000 Subject: [PATCH 12/20] Added AttachmentLoc to weapon mesh --- EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun.uasset | 4 ++-- .../Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun.uasset b/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun.uasset index ceecd3a8..fb9bcccb 100644 --- a/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun.uasset +++ b/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d1541e35feca0492ef7d3627594bf8a44a1d2df2de065eef10debc2ff10e5b82 -size 2639726 +oid sha256:a25bd766b410c091404860a06869807c72f401b56bb3a1176d4a9f059f62e3aa +size 2639719 diff --git a/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset b/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset index 069548d4..1ae83983 100644 --- a/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset +++ b/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:708dc110739caaf4ba73ad02c0d6e9610992e65d199b7939f2824b04ded9772f -size 9980 +oid sha256:b85a21b4490182847a169811c9d56eb5cc29caed440a79d6e1e1d4f6dc71faa6 +size 10333 From 826cadbbcb844ae5de7df1530fe6763c1fc09017 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 16:10:01 +0000 Subject: [PATCH 13/20] Added ExtendedMag code to give more ammo to the weapon --- .../AssaultRifles/BP_ARTEST1.uasset | 4 ++-- .../ExtendedMagAttachmentClass.cpp | 18 +++++++++++++++--- .../ExtendedMagAttachmentClass.h | 5 +++++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_ARTEST1.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_ARTEST1.uasset index f2ca1773..7efad0d9 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_ARTEST1.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_ARTEST1.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:da280a53ff9a19fc5698a2e4e87a2f0b6e4fd81c95fb5929a659cdb507b0d446 -size 41581 +oid sha256:2dd4b81f67f4c6069cc038ec8100dff8c3f4e28bbb79d37b10bcdd51f71f83d3 +size 41445 diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp index a571842b..fc1129ad 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.cpp @@ -3,6 +3,8 @@ #include "ExtendedMagAttachmentClass.h" +#include "EndlessVendetta/WeaponSystem/BaseWeaponClass.h" + // Sets default values for this component's properties UExtendedMagAttachmentClass::UExtendedMagAttachmentClass() @@ -19,9 +21,11 @@ UExtendedMagAttachmentClass::UExtendedMagAttachmentClass() void UExtendedMagAttachmentClass::BeginPlay() { Super::BeginPlay(); - - // ... - + BaseWeaponClass = Cast(this->GetAttachParentActor()); + if (BaseWeaponClass) + { + IncreaseAmmoCount(); + } } @@ -31,3 +35,11 @@ void UExtendedMagAttachmentClass::TickComponent(float DeltaTime, ELevelTick Tick Super::TickComponent(DeltaTime, TickType, ThisTickFunction); } +void UExtendedMagAttachmentClass::IncreaseAmmoCount() +{ + if (!IsValid(BaseWeaponClass)) return; + UE_LOG(LogTemp, Warning, TEXT("AmmoCountIncrease activated")); + BaseWeaponClass->MagazineSize *= 2; + BaseWeaponClass->currentAmmoCount = BaseWeaponClass->MagazineSize; +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h index f2dddee9..787af853 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h @@ -23,4 +23,9 @@ protected: public: // Called every frame virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; + + UPROPERTY(EditAnywhere) + class ABaseWeaponClass* BaseWeaponClass; + + void IncreaseAmmoCount(); }; From 62a85e8e79c6dd240a0e98c19fed7b34f38a079c Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 16:38:40 +0000 Subject: [PATCH 14/20] Stopped being able to stack already equipped attachments --- .../Workbench_UI/WBP_Workbench.uasset | 4 ++-- .../Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset index a5661453..7f18fa56 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c3646f88205f249df2cae1cf3f15ced54950f74f77e1ef5a7cd387fb36b65f41 -size 396176 +oid sha256:8ec31bc5dde88f89c5a5941dccf45637770883918c37f251690347f03498bcf2 +size 442680 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset index 97227d02..0b55c152 100644 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:58b8823622d837826bc46ebf642ee79cbd8db842b98245e6bb40023105787fa6 +oid sha256:b05d2a6eb6f40c493478477fa9a74d99ec844474dbcfb8e2cb315e4211fb1c39 size 6374 From ef4ce07b39ee824c58528c3abd264c4d6f9aa486 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 16:38:55 +0000 Subject: [PATCH 15/20] Fixed spawning workbench ui to be infinite to only happen once --- .../Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset index f7658767..472d92f5 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2d099a2a0950b5c1c4ac553c41cf946cbc1067c103b118c8559b58b6574a29f8 -size 148769 +oid sha256:c2bb9c6ddacdffc1091075490bd1e2bc256b848c7911a99834132b34eab1cdba +size 178140 From 4500562577e754ff499cb51c9873ac279292b2d9 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 16:39:08 +0000 Subject: [PATCH 16/20] Added empty base remove all attachment function class --- .../Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp | 5 +++++ .../Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp index dc15bb2e..1845d1c8 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp @@ -354,3 +354,8 @@ void ABaseWeaponClass::SetupGripAttachment(UStaticMesh* GripMesh) { } + +void ABaseWeaponClass::RemoveAllAttachments() +{ + +} diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h index 3d6a0635..2a67c1f6 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h @@ -172,6 +172,7 @@ public: //void GetOutHit(FHitResult OutHit); + //ATTACHMENTS UFUNCTION(BlueprintCallable) void SetupSilencerAttachment(UStaticMesh* SilencerMesh); @@ -181,6 +182,10 @@ public: UFUNCTION(BlueprintCallable) void SetupGripAttachment(UStaticMesh* GripMesh); + UFUNCTION(BlueprintCallable) + void RemoveAllAttachments(); + + // UFUNCTION(BlueprintImplementableEvent) void ShowReloadingWidget(); From 343ee8f985265ea6108244c752b77000d0c7c9ec Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 19 Mar 2024 16:49:37 +0000 Subject: [PATCH 17/20] Fixed Secondary weapon not being able to equip attachments --- .../Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset | 4 ++-- .../Workbench_UI/WBP_Workbench.uasset | 4 ++-- .../Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset index 472d92f5..b7e51127 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c2bb9c6ddacdffc1091075490bd1e2bc256b848c7911a99834132b34eab1cdba -size 178140 +oid sha256:3058523d1db3b3ce8bb608d719510ca31385f07e180d6ee49bc98d73950fe67d +size 177754 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset index 7f18fa56..78591665 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8ec31bc5dde88f89c5a5941dccf45637770883918c37f251690347f03498bcf2 -size 442680 +oid sha256:26924f8195e7ac346f3af93f0e09da9d4f255731448938c0cdb4ca23ee7369ca +size 463785 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset index 0b55c152..2ff136e1 100644 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b05d2a6eb6f40c493478477fa9a74d99ec844474dbcfb8e2cb315e4211fb1c39 +oid sha256:e535a9ac903c18e84682881e1006ef9f7a994c424a1392af6858bd91178b23a8 size 6374 From e2449fe1852bdec1219711666fc06b78f85dae5d Mon Sep 17 00:00:00 2001 From: MH261677 Date: Wed, 20 Mar 2024 16:07:22 +0000 Subject: [PATCH 18/20] Created GripAttachment Class and Added Grip Socket to pistol --- .../AnimatedPistol/Pistol_Skeleton.uasset | 4 +-- .../D/HT/HCK94DMZ442FV8M21GRO0Q.uasset | 2 +- .../GripAttachmentClass.cpp | 35 +++++++++++++++++++ .../GripAttachmentClass.h | 26 ++++++++++++++ 4 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/GripAttachmentClass.cpp create mode 100644 EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/GripAttachmentClass.h diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset index 95dbec74..cfe22307 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:42e8aa4a97d3707f88fbe1ada9b9abc4e0de881fc65bcfb759a46e39db613550 -size 8514 +oid sha256:bcd0987d98828fe75124f3bdbec4cb955591c45296cfb0a933d7b26f90542015 +size 9054 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset index 2ff136e1..428faf33 100644 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e535a9ac903c18e84682881e1006ef9f7a994c424a1392af6858bd91178b23a8 +oid sha256:3e9e0a24b83198ae0ade3feeb3113927c21a9c5554943157bf12b84964c81603 size 6374 diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/GripAttachmentClass.cpp b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/GripAttachmentClass.cpp new file mode 100644 index 00000000..79ba4488 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/GripAttachmentClass.cpp @@ -0,0 +1,35 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "GripAttachmentClass.h" + + +// Sets default values for this component's properties +UGripAttachmentClass::UGripAttachmentClass() +{ + // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features + // off to improve performance if you don't need them. + PrimaryComponentTick.bCanEverTick = true; + + // ... +} + + +// Called when the game starts +void UGripAttachmentClass::BeginPlay() +{ + Super::BeginPlay(); + + // ... + +} + + +// Called every frame +void UGripAttachmentClass::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) +{ + Super::TickComponent(DeltaTime, TickType, ThisTickFunction); + + // ... +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/GripAttachmentClass.h b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/GripAttachmentClass.h new file mode 100644 index 00000000..89d795a2 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/GripAttachmentClass.h @@ -0,0 +1,26 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Components/SceneComponent.h" +#include "GripAttachmentClass.generated.h" + + +UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent)) +class ENDLESSVENDETTA_API UGripAttachmentClass : public USceneComponent +{ + GENERATED_BODY() + +public: + // Sets default values for this component's properties + UGripAttachmentClass(); + +protected: + // Called when the game starts + virtual void BeginPlay() override; + +public: + // Called every frame + virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; +}; From df8fccfe57e0d3793cc7cff4603f8d2ad850cb57 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Wed, 20 Mar 2024 16:07:46 +0000 Subject: [PATCH 19/20] Created tempgrip and added workbench code for new grip attachment --- .../Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset | 4 ++-- .../Workbench_UI/WBP_Workbench.uasset | 4 ++-- EndlessVendetta/Content/StarterContent/Shapes/TempGrip.uasset | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 EndlessVendetta/Content/StarterContent/Shapes/TempGrip.uasset diff --git a/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset b/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset index 1ae83983..05540461 100644 --- a/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset +++ b/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b85a21b4490182847a169811c9d56eb5cc29caed440a79d6e1e1d4f6dc71faa6 -size 10333 +oid sha256:2dea0307b92ccbed30109943ac5590faf782a6883906b1583a171e1296bafd2a +size 10750 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset index 78591665..5346743d 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:26924f8195e7ac346f3af93f0e09da9d4f255731448938c0cdb4ca23ee7369ca -size 463785 +oid sha256:0ae694c450bf435ae7b867f11ce28e41372a31c1b0b6e8b6a1c8d19ee4f38baf +size 576887 diff --git a/EndlessVendetta/Content/StarterContent/Shapes/TempGrip.uasset b/EndlessVendetta/Content/StarterContent/Shapes/TempGrip.uasset new file mode 100644 index 00000000..35c3fed8 --- /dev/null +++ b/EndlessVendetta/Content/StarterContent/Shapes/TempGrip.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c9dc7d2236cc8b2c51501b90fb11df94a79d6085951375c97275bc705228633 +size 31406 From 2e6d88a53ffc0386481f769da530922511abf62f Mon Sep 17 00:00:00 2001 From: MH261677 Date: Wed, 20 Mar 2024 16:07:59 +0000 Subject: [PATCH 20/20] Added grip attachment code to baseweaponclass --- .../WeaponSystem/BaseWeaponClass.cpp | 32 ++++++++++++++++++- .../GripAttachmentClass.cpp | 2 -- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp index 1845d1c8..e871a7b4 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp @@ -14,6 +14,7 @@ #include "EndlessVendetta/BountySystem/ControlsTraining/TargetDummy.h" #include "EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h" +#include "EndlessVendetta/Workbench&Attachments/GripAttachmentClass.h" #include "EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.h" @@ -352,7 +353,36 @@ void ABaseWeaponClass::SetupExtendedMagAttachment(UStaticMesh* ExtendedMagMesh) //Called in weaponworkbench WBP void ABaseWeaponClass::SetupGripAttachment(UStaticMesh* GripMesh) { - + GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("SETTING UP GRIP ATTACHMENTS")); + FTransform EmptyTransform; + + USceneComponent* GripAttachmentClass = Cast(AddComponentByClass(UGripAttachmentClass::StaticClass(), false, EmptyTransform, false)); + GripAttachmentClass->ComponentTags.Add(FName("AttachmentType")); + USkeletalMeshComponent* WeaponSkeletonMesh = FindComponentByClass(); + if (IsValid(GripAttachmentClass)) + { + if (IsValid(WeaponSkeletonMesh)) + { + //this handles giving the weapon the required component class/code + GripAttachmentClass->AttachToComponent(WeaponSkeletonMesh, FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("GripMeshSocket"))); + UE_LOG(LogTemp, Display, TEXT("All Attachment is valid")); + //this makes it showup in editor for better debugging + GripAttachmentClass->CreationMethod = EComponentCreationMethod::Instance; + GripAttachmentClass->RegisterComponent(); + //below handles seeing the physical attachment you selected + UStaticMeshComponent* StaticMeshComp = NewObject(GripAttachmentClass, UStaticMeshComponent::StaticClass()); + if (IsValid(StaticMeshComp)) + { + StaticMeshComp->AttachToComponent(GripAttachmentClass, FAttachmentTransformRules::SnapToTargetIncludingScale); + StaticMeshComp->SetStaticMesh(GripMesh); + StaticMeshComp->SetRelativeRotation(FRotator(0, 0, 0)); + StaticMeshComp->SetCollisionEnabled(ECollisionEnabled::NoCollision); + //Making it show in editor for debugging + StaticMeshComp->CreationMethod = EComponentCreationMethod::Instance; + StaticMeshComp->RegisterComponent(); + } + } + } } void ABaseWeaponClass::RemoveAllAttachments() diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/GripAttachmentClass.cpp b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/GripAttachmentClass.cpp index 79ba4488..cbced9f9 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/GripAttachmentClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/GripAttachmentClass.cpp @@ -29,7 +29,5 @@ void UGripAttachmentClass::BeginPlay() void UGripAttachmentClass::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); - - // ... }