Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
v0.6.2a (#34)
Browse files Browse the repository at this point in the history
* Update Modular Features plugin + Create new settings class + Start adapting the project to MF Extra Features next changes

* Modular Features update: Add comments and adjust some shared functions to avoid repetitions

* Adjustments to enable multiple bindings mode

* Fix typo

* Fix typo + Adjust settings + update submodules + Add redirects

* Reset weak ptr

* Update submodules

* Add empty FilterPlugin.ini

* Update submodules

* Update version

* Update MF-EA submodule

* Update MF-EA settings

* Optimize includes + Update submodules

* Set internal log as Verbose by default

* Adjusting log: Set default verbosity as Log
  • Loading branch information
lucoiso authored Nov 12, 2022
1 parent f2e09d4 commit bcc233b
Show file tree
Hide file tree
Showing 65 changed files with 199 additions and 150 deletions.
3 changes: 3 additions & 0 deletions Config/DefaultEngine.ini
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ AssetManagerClassName=/Script/ProjectElementus.PEAssetManager

+FunctionRedirects=(OldName="PECharacter.EquipItem", NewName="PEInventoryComponent.EquipItem")
+FunctionRedirects=(OldName="PECharacter.UnnequipItem", NewName="PEInventoryComponent.UnnequipItem")
+FunctionRedirects=(OldName="PEInventoryComponent.UnnequipItem", NewName="PEInventoryComponent.UnequipItem")

+StructRedirects=(OldName="/Script/ProjectElementus.TargetActorSpawnParams", NewName="/Script/ProjectElementus.PETargetActorSpawnParams")

[/Script/WorldPartitionEditor.WorldPartitionEditorSettings]
bEnableWorldPartition=True
Expand Down
14 changes: 13 additions & 1 deletion Config/DefaultGame.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ProjectDebugTitleInfo=NSLOCTEXT("[/Script/EngineSettings]", "BE87C6DA4FF84CEDD63
ProjectDisplayedTitle=NSLOCTEXT("[/Script/EngineSettings]", "63DFDD624C6C2FDA67C19598742EFFE9", "Project Elementus:")
SupportContact[email protected]
CopyrightNotice=
ProjectVersion=0.6.1a
ProjectVersion=0.6.2a
CompanyName=Lucas Vilas-Boas
CompanyDistinguishedName=Lucoiso
Description=Project Elementus is a third person template that can be used to start projects that will use some new features that came with Unreal Engine 5 as well as powerful existing features like the Gameplay Ability System and others.
Expand Down Expand Up @@ -123,3 +123,15 @@ MetaDataTagsForAssetRegistry=()
[/Script/GameFeatures.GameFeaturesSubsystemSettings]
GameFeaturesManagerClassName=/Script/GameFeatures.DefaultGameFeaturesProjectPolicies

[/Script/ModularFeatures_ExtraActions.MFEA_Settings]
bEnableAbilityAutoBinding=False
InputIDEnumeration=/Game/Main/Data/GAS/EN_AbilityInputID.EN_AbilityInputID
AbilityBindingMode=InputID

[Staging]
+AllowedConfigFiles=ProjectElementus/Config/Tags/CharacterEquipmentSlots.ini
+AllowedConfigFiles=ProjectElementus/Config/Tags/GameplayAbilities.ini
+AllowedConfigFiles=ProjectElementus/Config/Tags/GameplayCues.ini
+AllowedConfigFiles=ProjectElementus/Config/Tags/GameplayData.ini
+AllowedConfigFiles=ProjectElementus/Config/Tags/GameplayEffects.ini
+AllowedConfigFiles=ProjectElementus/Config/Tags/GameplayStates.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

#include "PEHookAbility.h"
#include "PEHookAbility_Task.h"
#include "Actors/Character/PECharacter.h"
#include "GameFramework/Character.h"
#include "GAS/Targeting/PELineTargeting.h"
#include "GAS/System/PETrace.h"
#include "GeometryCollection/GeometryCollectionComponent.h"
#include "Management/Data/PEGlobalTags.h"

Expand Down Expand Up @@ -45,7 +46,7 @@ void UPEHookAbility::InputReleased(const FGameplayAbilitySpecHandle Handle, cons
void UPEHookAbility::WaitGameplayEvent_Callback_Implementation(FGameplayEventData Payload)
{
// Will start a targeting task when the animation notify is triggered (will try to start the hook)
FTargetActorSpawnParams TargetingParams;
FPETargetActorSpawnParams TargetingParams;
TargetingParams.StartLocation = MakeTargetLocationInfoFromOwnerSkeletalMeshComponent("hand_l");

ActivateWaitTargetDataTask(EGameplayTargetingConfirmation::Instant, APELineTargeting::StaticClass(), TargetingParams);
Expand Down Expand Up @@ -84,7 +85,7 @@ void UPEHookAbility::WaitTargetData_Callback_Implementation(const FGameplayAbili
ActivateGameplayCues(FGameplayTag::RequestGameplayTag("GameplayCue.Swinging"), Params);

// If the target is a character, will finish this ability after AbilityActiveTime seconds
if (TargetHit->GetActor()->GetClass()->IsChildOf<APECharacter>() && TargetHit->GetActor() != GetAvatarActorFromActorInfo() || TargetHit->GetComponent()->GetClass()->IsChildOf<UGeometryCollectionComponent>())
if (TargetHit->GetActor()->GetClass()->IsChildOf<ACharacter>() && TargetHit->GetActor() != GetAvatarActorFromActorInfo() || TargetHit->GetComponent()->GetClass()->IsChildOf<UGeometryCollectionComponent>())
{
FTimerDelegate TimerDelegate;
TimerDelegate.BindLambda([=]() -> void
Expand All @@ -107,7 +108,7 @@ void UPEHookAbility::WaitConfirmInput_Callback_Implementation()
// If the confirm input is pressed, will add a impulse to ability owner
// and to the target/grabbed actor, if simulates physics

if (APECharacter* const Player = Cast<APECharacter>(GetAvatarActorFromActorInfo()))
if (ACharacter* const Player = Cast<ACharacter>(GetAvatarActorFromActorInfo()))
{
PlayAbilitySoundAttached(Player->GetMesh());

Expand All @@ -119,7 +120,7 @@ void UPEHookAbility::WaitConfirmInput_Callback_Implementation()
{
TaskHandle->GetHitResult().GetComponent()->AddImpulse(-1.f * ImpulseVector);
}
else if (APECharacter* const TargetPlayer = Cast<APECharacter>(TaskHandle->GetHitResult().GetActor()))
else if (ACharacter* const TargetPlayer = Cast<ACharacter>(TaskHandle->GetHitResult().GetActor()))
{
TargetPlayer->LaunchCharacter(-1.f * ImpulseVector, false, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Repo: https://github.com/lucoiso/UEProject_Elementus

#include "PEHookAbility_Task.h"
#include "Actors/Character/PECharacter.h"
#include "GameFramework/Character.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "GeometryCollection/GeometryCollectionComponent.h"

Expand All @@ -29,13 +29,13 @@ void UPEHookAbility_Task::Activate()

check(Ability);

HookOwner = Cast<APECharacter>(GetAvatarActor());
HookOwner = Cast<ACharacter>(GetAvatarActor());

if (ensureAlwaysMsgf(HookOwner.IsValid(), TEXT("%s - Task %s failed to activate because have a invalid owner"), *FString(__func__), *GetName()))
{
CurrentHookLocation = HitDataHandle.Location;

HitTarget = Cast<APECharacter>(HitDataHandle.GetActor());
HitTarget = Cast<ACharacter>(HitDataHandle.GetActor());
if (!HitTarget.IsValid())
{
HitTarget.Reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class UPEHookAbility_Task final : public UAbilityTask
virtual void OnDestroy(bool AbilityIsEnding) override;

private:
TWeakObjectPtr<class APECharacter> HookOwner;
TWeakObjectPtr<APECharacter> HitTarget;
TWeakObjectPtr<class ACharacter> HookOwner;
TWeakObjectPtr<ACharacter> HitTarget;

float Intensity;
float MaxIntensity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "PETelekinesisAbility_Task.h"
#include "PEThrowableActor.h"
#include "GAS/Targeting/PELineTargeting.h"
#include "GAS/System/PETrace.h"
#include "Management/Data/PEGlobalTags.h"

UPETelekinesisAbility::UPETelekinesisAbility(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer), ThrowIntensity(2750.f)
Expand All @@ -23,7 +24,7 @@ void UPETelekinesisAbility::ActivateAbility(const FGameplayAbilitySpecHandle Han
Super::ActivateAbility(Handle, ActorInfo, ActivationInfo, TriggerEventData);

// Targeting: Params
FTargetActorSpawnParams TargetingParams;
FPETargetActorSpawnParams TargetingParams;
TargetingParams.TargetFilter.RequiredActorClass = APEThrowableActor::StaticClass();
TargetingParams.StartLocation = MakeTargetLocationInfoFromOwnerSkeletalMeshComponent("head");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "PEThrowableActor.h"
#include "Components/StaticMeshComponent.h"
#include "GAS/System/PEAbilityData.h"
#include "Actors/Character/PECharacter.h"
#include "GAS/System/PEAbilitySystemComponent.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#pragma once

#include "CoreMinimal.h"
#include "GAS/System/PEEffectData.h"
#include "Engine/StaticMeshActor.h"
#include "GAS/System/PEAbilityData.h"
#include "PEThrowableActor.generated.h"

class UGameplayEffect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Repo: https://github.com/lucoiso/UEProject_Elementus

#include "PECrouchAbility.h"
#include "Actors/Character/PECharacter.h"
#include "GameFramework/Character.h"

UPECrouchAbility::UPECrouchAbility(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
Expand All @@ -16,7 +16,7 @@ void UPECrouchAbility::ActivateAbility(const FGameplayAbilitySpecHandle Handle,
{
Super::ActivateAbility(Handle, ActorInfo, ActivationInfo, TriggerEventData);

APECharacter* const Player = Cast<APECharacter>(ActorInfo->AvatarActor.Get());
ACharacter* const Player = Cast<ACharacter>(ActorInfo->AvatarActor.Get());

// Only characters can activate this ability
if (!IsValid(Player))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Repo: https://github.com/lucoiso/UEProject_Elementus

#include "PEDoubleJumpAbility.h"
#include "Actors/Character/PECharacter.h"
#include "GameFramework/Character.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "Management/Data/PEGlobalTags.h"

Expand All @@ -21,7 +21,7 @@ void UPEDoubleJumpAbility::ActivateAbility(const FGameplayAbilitySpecHandle Hand
{
Super::ActivateAbility(Handle, ActorInfo, ActivationInfo, TriggerEventData);

APECharacter* const Player = Cast<APECharacter>(ActorInfo->AvatarActor.Get());
ACharacter* const Player = Cast<ACharacter>(ActorInfo->AvatarActor.Get());

// Only characters can activate this ability
if (!IsValid(Player))
Expand Down Expand Up @@ -55,7 +55,7 @@ void UPEDoubleJumpAbility::InputReleased(const FGameplayAbilitySpecHandle Handle
Super::InputReleased(Handle, ActorInfo, ActivationInfo);

// Send the StopJumping event to the player if valid
if (APECharacter* const Player = Cast<APECharacter>(ActorInfo->AvatarActor.Get()))
if (ACharacter* const Player = Cast<ACharacter>(ActorInfo->AvatarActor.Get()))
{
Player->StopJumping();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "PEInteractAbility.h"
#include "Actors/Character/PECharacter.h"
#include "Actors/Interfaces/PEInteractable.h"
#include "GAS/System/PEAbilitySystemComponent.h"
#include "Tasks/PEInteractAbility_Task.h"

UPEInteractAbility::UPEInteractAbility(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// Repo: https://github.com/lucoiso/UEProject_Elementus

#include "PESprintAbility.h"

#include "Management/Data/PEGlobalTags.h"

UPESprintAbility::UPESprintAbility(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include "CoreMinimal.h"
#include "GAS/System/PEGameplayAbility.h"
#include "Tasks/PEInteractAbility_Task.h"
#include "PEInteractAbility.generated.h"

class UPEInteractAbility_Task;
/**
*
*/
Expand Down
Binary file not shown.
Binary file modified Plugins/GameFeatures/Weapons/Content/Data/DA_Pistol.uasset
Binary file not shown.
2 changes: 1 addition & 1 deletion Plugins/UEEOSSDKHandler
2 changes: 1 addition & 1 deletion Plugins/UEFSR
Submodule UEFSR updated 1 files
+1 −0 Config/FilterPlugin.ini
5 changes: 3 additions & 2 deletions ProjectElementus.uproject
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"Engine"
"Engine",
"DeveloperSettings"
]
}
],
Expand Down Expand Up @@ -46,7 +47,7 @@
{
"Name": "EOSSDKHandler",
"Enabled": true
},
}
],
"TargetPlatforms": [
"Linux",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "Components/PEInventoryComponent.h"
#include "Components/CapsuleComponent.h"
#include "Components/GameFrameworkComponentManager.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "AbilitySystemLog.h"
#include "Actors/Character/PEPlayerState.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
#include "Actors/Character/PEPlayerState.h"
#include "GameFramework/GameModeBase.h"
#include "GameFramework/PlayerState.h"
#include "GAS/System/PEAbilitySystemComponent.h"
#include "Kismet/KismetSystemLibrary.h"
#include "Management/PEGameInstance.h"
#include "Blueprint/UserWidget.h"
#include "Components/PEInventoryComponent.h"
#include "ElementusInventoryFunctions.h"
#include "Management/Data/PEGlobalTags.h"
#include "Management/Functions/PEPlayerLibrary.h"
#include "Management/Functions/PEEOSLibrary.h"
#include "MFEA_Settings.h"

constexpr float BaseTurnRate = 45.f;
constexpr float BaseLookUpRate = 45.f;
Expand All @@ -32,10 +30,10 @@ APEPlayerController::APEPlayerController(const FObjectInitializer& ObjectInitial
PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.bStartWithTickEnabled = true;

static const ConstructorHelpers::FObjectFinder<UEnum> InputIDEnum_ObjRef(TEXT("/Game/Main/Data/GAS/EN_AbilityInputID"));
if (InputIDEnum_ObjRef.Succeeded())
if (const UMFEA_Settings* MF_Settings = GetDefault<UMFEA_Settings>();
!MF_Settings->InputIDEnumeration.IsNull())
{
InputEnumHandle = InputIDEnum_ObjRef.Object;
InputEnumHandle = MF_Settings->InputIDEnumeration.LoadSynchronous();
}

static ConstructorHelpers::FClassFinder<UUserWidget> InventoryWidget_ClassRef(TEXT("/Game/Main/Blueprints/Widgets/Inventory/WB_Inventory_Example"));
Expand Down Expand Up @@ -83,7 +81,7 @@ void APEPlayerController::RespawnAndPossess_Implementation()
{
if (const APEPlayerState* const State = GetPlayerState<APEPlayerState>())
{
if (UPEAbilitySystemComponent* AbilitySystemComp_Ref = CastChecked<UPEAbilitySystemComponent>(State->GetAbilitySystemComponent()))
if (UAbilitySystemComponent* const AbilitySystemComp_Ref = State->GetAbilitySystemComponent())
{
AbilitySystemComp_Ref->RemoveActiveEffectsWithTags(FGameplayTagContainer(FGameplayTag::RequestGameplayTag(GlobalTag_DeadState)));
}
Expand Down Expand Up @@ -166,7 +164,7 @@ void APEPlayerController::ProcessTrade_Internal(const TArray<FElementusItemInfo>

#pragma region IAbilityInputBinding
// Double "_Implementation" because this function is a RPC call version of a virtual function from IAbilityBinding interface
void APEPlayerController::SetupAbilityInputBinding_Implementation_Implementation(UInputAction* Action, const int32 InputID)
void APEPlayerController::SetupAbilityBindingByInput_Implementation_Implementation(UInputAction* Action, const int32 InputID)
{
if (!IsValid(Action))
{
Expand Down Expand Up @@ -225,23 +223,23 @@ void APEPlayerController::OnAbilityInputPressed(UInputAction* SourceAction)
CONTROLLER_BASE_VLOG(this, Display, TEXT("%s called with Action %s and Input ID Value %u"), *FString(__func__), *SourceAction->GetName(), InputID);

// Check if controller owner is valid and owns a ability system component
if (const APECharacter* const ControllerOwner = GetPawn<APECharacter>();
ensureAlwaysMsgf(IsValid(ControllerOwner->GetAbilitySystemComponent()), TEXT("%s owner have a invalid AbilitySystemComponent"), *GetName()))
if (UAbilitySystemComponent* const TargetABSC = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(GetPawn());
ensureAlwaysMsgf(IsValid(TargetABSC), TEXT("%s owner have a invalid AbilitySystemComponent"), *GetName()))
{
// Send the input pressed event to the ability system component with the found input ID
ControllerOwner->GetAbilitySystemComponent()->AbilityLocalInputPressed(InputID);
TargetABSC->AbilityLocalInputPressed(InputID);

// Verify if the found input ID is equal to Confirm or Cancel input from the specified Enumeration class
if (ensureAlwaysMsgf(InputEnumHandle.IsValid(), TEXT("%s have a invalid InputEnumHandle"), *GetName()))
{
if (InputID == InputEnumHandle->GetValueByName("Confirm", EGetByNameFlags::CheckAuthoredName))
{
ControllerOwner->GetAbilitySystemComponent()->LocalInputConfirm();
TargetABSC->LocalInputConfirm();
}

else if (InputID == InputEnumHandle->GetValueByName("Cancel", EGetByNameFlags::CheckAuthoredName))
{
ControllerOwner->GetAbilitySystemComponent()->LocalInputCancel();
TargetABSC->LocalInputCancel();
}
}
}
Expand All @@ -266,11 +264,11 @@ void APEPlayerController::OnAbilityInputReleased(UInputAction* SourceAction)
CONTROLLER_BASE_VLOG(this, Display, TEXT("%s called with Action %s and Input ID Value %u"), *FString(__func__), *SourceAction->GetName(), InputID);

// Check if controller owner is valid and owns a ability system component
if (const APECharacter* const ControllerOwner = GetPawn<APECharacter>();
ensureAlwaysMsgf(IsValid(ControllerOwner->GetAbilitySystemComponent()), TEXT("%s owner have a invalid AbilitySystemComponent"), *GetName()))
if (UAbilitySystemComponent* const TargetABSC = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(GetPawn());
ensureAlwaysMsgf(IsValid(TargetABSC), TEXT("%s owner have a invalid AbilitySystemComponent"), *GetName()))
{
// Send the input released event to the ability system component with the found input ID
ControllerOwner->GetAbilitySystemComponent()->AbilityLocalInputReleased(InputID);
TargetABSC->AbilityLocalInputReleased(InputID);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include "Actors/Character/PECharacter.h"
#include "Actors/Character/PEPlayerController.h"
#include "GAS/System/PEAbilitySystemComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "Components/GameFrameworkComponentManager.h"
#include "Management/Data/PEGlobalTags.h"

DEFINE_LOG_CATEGORY(LogPlayerState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
#include "Actors/Interfaces/PEEquipment.h"

UPEEquipment::UPEEquipment(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{

{
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
// Repo: https://github.com/lucoiso/UEProject_Elementus

#include "Actors/World/PEConsumableActor.h"

#include "AbilitySystemGlobals.h"
#include "Management/Data/PEConsumableData.h"
#include "GAS/System/PEAbilitySystemComponent.h"
#include "Components/StaticMeshComponent.h"
#include "NiagaraComponent.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
#include "Actors/World/PEExplosiveActor.h"
#include "Actors/Character/PECharacter.h"
#include "GAS/System/PEAbilitySystemComponent.h"
#include "Components/PrimitiveComponent.h"
#include "GAS/System/PEAbilityData.h"
#include "NiagaraFunctionLibrary.h"
#include "NiagaraSystem.h"
#include "NiagaraComponent.h"

APEExplosiveActor::APEExplosiveActor(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer), ExplosionRadius(150.f), ExplosionMagnitude(1000.f), bDestroyAfterExplosion(true), bDebug(false)
{
Expand Down
Loading

0 comments on commit bcc233b

Please sign in to comment.