Creating & Editing Buffs
Last updated
Was this helpful?
Last updated
Was this helpful?
Run the Soulslike Status Effect Creator from the Soulslike Framework editor dropdown or head into /SoulslikeFramework/_Utility/Creators and right-click and Run Utility Widget -> EUW_StatusEffectCreator:
Fill in the details as you desire:
On the Ranks dropdown, you might notice something different. The RelevantData property is of type FInstancedStruct. This property can be used to send in any type of data to the Status Effect logic class. Search for "FStatus" to see Status Effect related structs provided by the framework:
For this example, lets use FStatusEffectStatChanges to just adjust some stats when this status effect is triggered. We'll adjust FP & Stamina:
Finalize by clicking Create Status Effect.
To test your new Status Effect, put one of the actors B_StatusEffectArea or B_StatusEffectOneShot into your level. Configure its StatusEffectToApply & Effect Rank properties:
You will notice the new Status Effect build up when overlapping this actor:
And when Buildup reaches 100%, your Status Effect will be triggered:
If you want a unique trigger behavior for a Status Effect , you can easily override the EffectTriggered
function inside your new Status Effect logic class and customize it.
Start by creating a new Struct and add in properties that you will be relevant for your effect. In this example, we will make our new Plague status effect adjust the stats of the player AND reduce the scale of the player. For this, we will add 3 properties to our struct:
FStatusEffectStatChanges (Stat Changes)
Float (New Scale)
Float (Duration)
Run the Soulslike Status Effect Browser from the Soulslike Framework editor dropdown or head into /SoulslikeFramework/_Utility/Browsers and right-click and Run Utility Widget -> EUW_StatusEffectBrowser.
Find our new Status Effect and adjust its RelevantData property to use our new Struct:
Click on Open Logic to open the class blueprint. Override the EffectTriggered
method and start writing your logic. You can take a look at the parent Status Effect Object class and/or the Frostbite Status Effect for reference.
The example above will:
Adjust all provided Stats negatively
Set the Owner (player character)'s scale to the desired value, and after the duration, reset it back to 1.0f.
IMPORTANT: Overriding the EffectTriggered
method means that you lose access to the parent trigger functionality. This means that if you create a new Rank with a different RelevantData type, it will not execute unless you're specifically handling that data type.
You can Add Call to Parent but this might result in unwanted behavior.
An acceptable way of doing this would be through copying some of the EffectTriggered
logic from the parent Status Effect Object class to your new Status Effect class.