Merge branch 'attachment-bug-fix' into Bounty-System-Rework

# Conflicts:
#	EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
#	EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset
This commit is contained in:
RAFAL SWIERCZEK 2024-02-02 10:57:40 +00:00
commit d943495179
23 changed files with 85 additions and 75 deletions

View File

@ -9,12 +9,11 @@
<component name="ChangeListManager">
<list default="true" id="8acc2658-cb31-4c49-857f-282cfee74640" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/Levels/MainMenuLevel.umap" beforeDir="false" afterPath="$PROJECT_DIR$/Content/Levels/MainMenuLevel.umap" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/StarterContent/Particles/P_Ambient_Dust.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/Particles/P_Ambient_Dust.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/EndlessVendettaCharacter.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/EndlessVendettaCharacter.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/MainSaveGameClass.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/MainSaveGameClass.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/Pistol_Assets/SM_HandGun_Skeleton.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/Pistol_Assets/SM_HandGun_Skeleton.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -41,7 +40,7 @@
&quot;C++ Project.EndlessVendetta.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;Bounty-System-Rework&quot;,
&quot;git-widget-placeholder&quot;: &quot;attachment-bug-fix&quot;,
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
@ -52,13 +51,13 @@
},
&quot;keyToStringList&quot;: {
&quot;rider.external.source.directories&quot;: [
&quot;C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\DecompilerCache&quot;,
&quot;C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\SourcesCache&quot;,
&quot;C:\\Users\\Rafal\\AppData\\Local\\Symbols\\src&quot;
&quot;C:\\Users\\mhara\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\DecompilerCache&quot;,
&quot;C:\\Users\\mhara\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\SourcesCache&quot;,
&quot;C:\\Users\\mhara\\AppData\\Local\\Symbols\\src&quot;
]
}
}</component>
<component name="RunManager" selected="C++ Project.EndlessVendetta">
<component name="RunManager">
<configuration name="EndlessVendetta" type="CppProject" factoryName="C++ Project">
<configuration_1>
<option name="CONFIGURATION" value="DebugGame Editor" />
@ -132,29 +131,18 @@
<workItem from="1705685813496" duration="6457000" />
<workItem from="1705756768038" duration="3821000" />
<workItem from="1705856571902" duration="3954000" />
<workItem from="1706036726146" duration="5339000" />
<workItem from="1706101472121" duration="21314000" />
<workItem from="1706203836052" duration="7461000" />
<workItem from="1706626387819" duration="5432000" />
<workItem from="1706711852868" duration="19944000" />
<workItem from="1706799696925" duration="11011000" />
<workItem from="1706838825990" duration="4397000" />
<workItem from="1706110241756" duration="1092000" />
<workItem from="1706705451486" duration="5218000" />
<workItem from="1706727398145" duration="597000" />
<workItem from="1706790490396" duration="10304000" />
<workItem from="1706802528693" duration="3999000" />
<workItem from="1706807322577" duration="2357000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="UnitTestsCoverage.Settings">
<option name="coveragePercentColumnWidth" value="150" />
<option name="sortOrder" value="DESCENDING" />
<option name="sortedColumn" value="1" />
<option name="symbolColumnWidth" value="346" />
<coverage-tree-state>
<expand />
<select />
</coverage-tree-state>
</component>
<component name="VcsManagerConfiguration">
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
</component>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -101,6 +101,7 @@ void ABaseWeaponClass::GenerateRecoilVector()
void ABaseWeaponClass::ApplyRecoil(float DeltaTime)
{
if (!endlessVendettaChar->bHasRifle) return;
if (recoilTime < 0.3)
{
float amplitude = RecoilCurve->GetFloatValue(recoilTime); //get current value of curve in time
@ -257,13 +258,33 @@ void ABaseWeaponClass::InteractPrompt()
void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh)
{
FTransform emptytransform;
UActorComponent* SilencerComponent = AddComponentByClass(USilencerAttachmentClass::StaticClass(), true, emptytransform, false);
Cast<USilencerAttachmentClass>(SilencerComponent)->AttachToComponent(RootComponent, FAttachmentTransformRules::SnapToTargetIncludingScale);
TArray<UActorComponent*> SilencerMeshSocketArray (GetComponentsByTag(UStaticMeshComponent::StaticClass(), FName("SilencerMeshSocket")));
Cast<UStaticMeshComponent>(SilencerMeshSocketArray[0])->SetStaticMesh(SilencerMesh);
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("SETTING UP SILENCER ATTACHMENTS"));
FTransform EmptyTransform;
USceneComponent* SilencerAttachmentClass = Cast<USceneComponent>(AddComponentByClass(USilencerAttachmentClass::StaticClass(), false, EmptyTransform, false));
SilencerAttachmentClass->ComponentTags.Add(FName("AttachmentType"));
USkeletalMeshComponent* WeaponSkeletonMesh = FindComponentByClass<USkeletalMeshComponent>();
if (IsValid(SilencerAttachmentClass))
{
if (IsValid(WeaponSkeletonMesh))
{
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();
UStaticMeshComponent* StaticMeshComp = NewObject<UStaticMeshComponent>(SilencerAttachmentClass, UStaticMeshComponent::StaticClass());
if (IsValid(StaticMeshComp))
{
StaticMeshComp->AttachToComponent(SilencerAttachmentClass, FAttachmentTransformRules::SnapToTargetIncludingScale);
StaticMeshComp->SetStaticMesh(SilencerMesh);
StaticMeshComp->SetRelativeRotation(FRotator(0,90,0));
StaticMeshComp->SetCollisionEnabled(ECollisionEnabled::NoCollision);
//Making it show in editor for debugging
StaticMeshComp->CreationMethod = EComponentCreationMethod::Instance;
StaticMeshComp->RegisterComponent();
}
}
}
}

View File

@ -29,7 +29,5 @@ void USilencerAttachmentClass::BeginPlay()
void USilencerAttachmentClass::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
// ...
}