This section describes how to add a new Gameplay effect that affects a stat.
Im using the project created in the “Integration in new project” section for this guide and the created stat from “Bind Custom Values”, but you can use any other stat.
Step 1 - Base Class
To add a new effect, simply create a child class of one of the base classes.
I also created some subclasses for common cases.
- GE_Duration is the basic effect that lasts for x seconds
- GE_Ticking is a extended version and has a function that ticks x times while active (time between ticks will be calculated by the duration and ticks)
- GE_Duration_DamageProcessing can be used for shield effects / absorbs / damage reduction
- GE_Duration_ApplyModifier can be used for increasing/decreasing stats
- GE_Ticking_DamageOverTime can be used for damage effects
- GE_OneTimeEffect is a base class for one time effects, they will only execute the start function
I create a subclass of GE_Duration for this guide and name it GE_Duration_IncreaseAttackSpeed
Step 2 - Custom functions
When using a stacking effect you need to update the existing modifier when the stack size is changing.
Make sure you check “OverrideExistingModifier” to ensure the old modifier will be overridden with the new.
The value of the modifier is stacksize × value. In this case im adding 0.2 attackspeed per stack.
Step 3 - Testing
When Pressing Play and walking over the gameplay effect tester, the effect should be visible in the effect bar and the print string should be 0.2 per stack.