Configure the Gameplay Ability System
Using Ninja GAS, you can configure the Gameplay Ability System in your project and prepare your Player Character, so it can use the Combat Attribute Set provided by Ninja Combat.
Add Ninja GAS and Combat to your project
Follow the steps from the Ninja GAS setup page.
Follow the steps from the Ninja Combat setup page.
Configure the Combat Attribute Data Table
Create a Data Table using
AttributeMetaData
as the row type.Save the sample Json data to your computer and import it in your Data Table, by pressing the Reimport button.
Create the Player Abilities Data Set
Create a GAS Setup, either using the contextual menu or creating a data asset based on
NinjaGASDataAsset
.Make sure to create this Data Asset in the folder configured in the Asset Manager, during the initial setup for Ninja G.A.S..
Open the Data Asset, add a new entry to Default Attribute Sets and set
NinjaCombatAttributeSet
to Attribute Set Class. As for the Attribute Table, add the Data Table created on the previous step.Add a new entry to Default Gameplay Effects and set
CombatEffect_ReplenishStamina
to Gameplay Effect Class, this will be useful later!
Create a GAS-compatible Player State
Create a new Blueprint Class selecting
NinjaGASPlayerState
as the base class.Open the new Player State, select the Ability System Component and set the Data Asset that was created in the previous setup as the Default Ability Setup.
Set your new Player State to your Game Mode.
Reparent the Player Character
Open your Character Blueprint and reparent it to
NinjaGASPlayerCharacter
.In your player Animation Blueprint, add a slot for the Attack Abilities, such as Default Slot or Full Body for example.
Test everything
Press play, you should see your Player Character, as usual.
Type the following command in your Console:
showdebug AbilitySystem
Back in your game, you should see lots of GAS-related information, including all attributes from Ninja Combat.