🚀 Spring Sale is live! 🚀 Don't miss your chance to get all my products at 30% OFF!  

Get it!

Gameplay Effects Container

Gameplay Effect

Any GameplayEffectClass you have created under unreal editor, you can treat it as a definition of a gameplay effect.

You can think of gameplay effect as an asset that stores static data, and a GameplayEffectSpec is the instance of GameplayEffectClass.

Since spec is a structure that contains a lot of information, in order to pass it around without making a lot of copies, there is a lightweight structure called ‘gameplay effect spec handle’, which contains a pointer to spec. So, in blueprint/C++, we usually pass the spec handle in different places and operate on it.

This is the simplest example of creating gameplay effect spec and applying it:

gga guide apply ge

What attributes will change was configured in your gameplay effect, and somewhere in your code you need to respond to these attribute changes based on your game design.

Gameplay Effect Container

Original implementation

GGA also implements the GameplayEffectContainer described in this section .

gga guide 33

Containers in GGA

The difference is that you can use containers anywhere in the game, not just within ability.

You can access the relevant API through GGA_ GameplayEffectContainerFunctionLibrary.

gga guide 34

At the same time, in the Targeting section, I abandoned the "TargetType" method mentioned in the original implementation and instead adopted the "Gameplay Targeting System" provided by UE5.2.

How to use

You can forget about the two paragraphs above and read just this part. In brief:

GameplayEffectContainer: is a simple structure that defines a TargetingPreset and multiple GameplayEffects, which you can think of as “a bunch of game effect definitions”.

GameplayEffectContainerSpec: is an instance of GameplayEffectContainer, which contains a TargetData field (the result of the target obtained from the TargetingPreset), and TargetGameplayEffectSpecs field (instances of GameplayEffects defined in the Container).

When you apply a GameplayEffectContainerSpec, you are batch applying multiple GameplayEffectSpecs to all Actors within the TargetData(Targets were fetched by Gameplay Targeting System).

The simplest way to use the process is as follows:

gga guide 35
In most cases, it is recommended to use this method to apply multiple game effects to multiple targets at the same time, which is more efficient.
请先尝试制作简单的陷阱Actor,给进入的玩家用Container的方式施加GE。 Container底层还会用到GameplayTargetingSystem,用来获取目标的,把它也得先搞明白。然后再尝试下面的制作近战流程。