Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Config/DefaultEngine.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ NearClipPlane=0.010000
+Profiles=(Name="Ragdoll",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="PhysicsBody",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="MyCharacter",Response=ECR_Ignore)),HelpMessage="Simulating Skeletal Mesh Component. All other channels will be set to default.")
+Profiles=(Name="Vehicle",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="Vehicle",CustomResponses=,HelpMessage="Vehicle object that blocks Vehicle, WorldStatic, and WorldDynamic. All other channels will be set to default.")
+Profiles=(Name="UI",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap),(Channel="MyCharacter",Response=ECR_Overlap)),HelpMessage="WorldStatic object that overlaps all actors by default. All new custom channels will use its own default response. ")
+Profiles=(Name="MyCharacter",CollisionEnabled=QueryAndPhysics,bCanModify=True,ObjectTypeName="MyCharacter",CustomResponses=((Channel="MyCollectable",Response=ECR_Overlap),(Channel="MyC4",Response=ECR_Overlap),(Channel="BuyCheck",Response=ECR_Overlap)),HelpMessage="Needs description")
+Profiles=(Name="MyCharacter",CollisionEnabled=QueryAndPhysics,bCanModify=True,ObjectTypeName="MyCharacter",CustomResponses=((Channel="MyCollectable",Response=ECR_Overlap),(Channel="MyC4",Response=ECR_Overlap),(Channel="BuyCheck",Response=ECR_Overlap),(Channel="ItemCheck",Response=ECR_Overlap)),HelpMessage="Needs description")
+Profiles=(Name="MyCollectable",CollisionEnabled=QueryAndPhysics,bCanModify=True,ObjectTypeName="MyCollectable",CustomResponses=((Channel="MyCharacter",Response=ECR_Overlap),(Channel="ItemCheck")),HelpMessage="Needs description")
+Profiles=(Name="MyC4",CollisionEnabled=QueryAndPhysics,bCanModify=True,ObjectTypeName="MyC4",CustomResponses=((Channel="MyCharacter",Response=ECR_Overlap),(Channel="MyPlantableArea",Response=ECR_Overlap),(Channel="ItemCheck",Response=ECR_Overlap)),HelpMessage="Needs description")
+Profiles=(Name="MyPlantableArea",CollisionEnabled=QueryOnly,bCanModify=True,ObjectTypeName="MyPlantableArea",CustomResponses=((Channel="WorldStatic",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Ignore),(Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Destructible",Response=ECR_Ignore),(Channel="MyCharacter",Response=ECR_Ignore),(Channel="Attack",Response=ECR_Ignore),(Channel="MyCollectable",Response=ECR_Ignore),(Channel="PlantCheck")),HelpMessage="Needs description")
Expand Down Expand Up @@ -133,6 +133,9 @@ NearClipPlane=0.010000
+PropertyRedirects=(OldName="/Script/MyProject.MyAimableWeapon.MuzzleFlash",NewName="/Script/MyProject.MyAimableWeapon.BulletTrail")
+ClassRedirects=(OldName="/Script/MyProject.MySkeletalMeshCollectable",NewName="/Script/MyProject.MySkeletalMeshCollectable")
+PropertyRedirects=(OldName="/Script/MyProject.MyCollectable.Mesh",NewName="/Script/MyProject.MyCollectable.MeshComponent")
+ClassRedirects=(OldName="/Script/MyProject.MyFragGrenadeItem",NewName="/Script/MyProject.MyFragGrenade")
+PropertyRedirects=(OldName="/Script/MyProject.MyCharacter.HandWeapon",NewName="/Script/MyProject.MyCharacter.HandCollectable")
+FunctionRedirects=(OldName="/Script/MyProject.MyCharacter.Server_AttachArmWeapon",NewName="/Script/MyProject.MyCharacter.Server_AttachArmCollectable")

[/Script/Engine.AudioSettings]
DefaultSoundConcurrencyName=/Game/Blueprints/NewSoundConcurrency.NewSoundConcurrency
Expand Down
Binary file modified Content/Blueprints/BPMyC4.uasset
Binary file not shown.
10 changes: 6 additions & 4 deletions Source/MyProject/MyAmmoWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void UMyAmmoWidget::BindPlayerState(AMyPlayerState* PlayerState) const
if (IsValid(PlayerState))
{
PlayerState->BindOnStateChanged(this, &UMyAmmoWidget::HandleStateChanged);
PlayerState->BindOnWeaponChanged(this, &UMyAmmoWidget::HandleWeaponChanged);
PlayerState->BindOnHandChanged(this, &UMyAmmoWidget::HandleWeaponChanged);
}
}

Expand All @@ -35,7 +35,7 @@ void UMyAmmoWidget::HandleStateChanged(AMyPlayerState* PlayerState, const EMyCha
}
else
{
if (PlayerState->GetWeapon() == nullptr)
if (Cast<AMyWeapon>(PlayerState->GetCurrentHand()) == nullptr)
{
AmmoText->SetText(FText::FromString(TEXT("")));
}
Expand All @@ -46,10 +46,12 @@ void UMyAmmoWidget::HandleStateChanged(AMyPlayerState* PlayerState, const EMyCha

void UMyAmmoWidget::HandleWeaponChanged(AMyPlayerState* PlayerState) const
{
if (IsValid(PlayerState->GetWeapon()))
const auto& Weapon = Cast<AMyWeapon>(PlayerState->GetCurrentHand());

if (IsValid(Weapon))
{
LOG_FUNC(LogTemp, Warning, "Weapon changed, update ammo count");
const auto& StatComponent = PlayerState->GetWeapon()->GetWeaponStatComponent();
const auto& StatComponent = Weapon->GetWeaponStatComponent();
UpdateAmmo(StatComponent->GetCurrentAmmoCount(), StatComponent->GetRemainingAmmoCount());
}
else
Expand Down
2 changes: 1 addition & 1 deletion Source/MyProject/MyAnimInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void UMyAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
Horizontal = FVector::DotProduct(Velocity, Character->GetActorRightVector());
Yaw = Character->GetActorRotation().Yaw;
Pitch = Character->GetPitchInput();
bHasWeapon = IsValid(Cast<AMyAimableWeapon>(Character->GetWeapon()));
bHasWeapon = IsValid(Character->TryGetWeapon());
}

FName UMyAnimInstance::GetAttackMontageSectionName(const int32 NewIndex)
Expand Down
5 changes: 3 additions & 2 deletions Source/MyProject/MyC4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ bool AMyC4::IsDefusable(const bool bCheckSpeed) const

TArray<FOverlapResult> OverlapResult;

const auto& DefuserCheck = GetWorld()->OverlapMultiByObjectType
const auto& DefuserCheck = GetWorld()->OverlapMultiByChannel
(
OverlapResult,
GetActorLocation(),
FQuat::Identity,
ObjectParams,
ECC_GameTraceChannel1,
FCollisionShape::MakeSphere(50.f),
Params
);
Expand Down Expand Up @@ -506,6 +506,7 @@ bool AMyC4::TryDefuse(AMyCharacter* Character)
if (!IsDefusable(false))
{
LOG_FUNC(LogTemp, Warning, "Bomb is not defusable");
DefusingCharacter = nullptr;
return false;
}

Expand Down
Loading