Documentation: Initial Setup - lucoiso/UEModularFeatures_ExtraActions GitHub Wiki
Installation (Github)
Clone this repository or download the .zip file in the latest version from Release page and drop the files inside the 'Plugins/' folder of your project folder. Note that if your project doesn't have a 'Plugins' folder, you can create one.
Installation (Unreal Marketplace)
Download and install the plugin directly from Unreal Marketplace.
Settings
Fill the settings with default parameters.
Ability Binding
There are 4 options to bind abilities that you can choose on Project Settings -> Modular Features: Extra Actions. The choosen option will determine wich function from IMFEA_AbilityInputBinding interface you'll need to implement on your input owner:
- Input ID: SetupAbilityBindingByInput
- Ability Class: SetupAbilityBindingByClass
- Ability Spec: SetupAbilityBindingBySpec
- Ability Tags: SetupAbilityBindingByTags
The plugin will try to call these functions to bind the abilities to the selected class according to the selected option on Project Settings.
And as you have a created function to add the abilities, you'll need to implement a way to remove them too, by using the function RemoveAbilityInputBinding from the same IMFEA_AbilityInputBinding interface.
C++ include:
#include "Interfaces/MFEA_AbilityInputBinding.h"
Add/Remove Framework Receiver
Classes that can receive the framework need to send themselves as Game Framework Component Receiver and when they are ready to receive the framework, send the Game ActorReadyGame Framework Component Extension Event. This is necessary to enable the target actor to receive the Modular Features like Abilities, Components, etc.
Via C++ you can manage this by adding this calls:
Add Receiver (Your target needs to be registered as a receiver):
UGameFrameworkComponentManager::AddGameFrameworkComponentReceiver(this);
Remove Receiver (Call this when you want to remove a target as a receiver):
UGameFrameworkComponentManager::RemoveGameFrameworkComponentReceiver(this);
Send Extension Event (Call this when the target is ready to receive the modular framework):
UGameFrameworkComponentManager::SendGameFrameworkComponentExtensionEvent(this, UGameFrameworkComponentManager::NAME_GameActorReady);