1. Home
  2. Docs
  3. Damage Resource and Stat System
  4. Starter Guides
  5. Bind Custom Values

Bind Custom Values

Custom values are values that should be modifiable by gameplay effects but are not integrated by the system at default. An example is MaxWalkSpeed, this variable is in the movement component from Epic games. To make it dynamically modifiable, it must be integrated into the system.

Requirements: your value must have a base value that represent the value without modifiers.

Step 1

Create a new entry in E_ModifiableValues that describes your value.

Step 2

If the Actor with the value directly owns a GameplayEffect component, you can simply use the dispatcher event OnModifierChange.

if the value is in a component or similar, the dispatcher must be bind manually.

Bind the dispatcher manually, you will need a reference to a gameplay effect component.

In most cases (in the main components) I use the get owner -> get component by class function (see attatched image). This only works if the owner has a gameplay effect component.

In cases like the UI, I use a gameplay effect component variable that I set when generating the UI.

Step 3

When the dispatcher is called, all bound eventscheck if a value has been changed for which they are “responsible” and recalculate this value,┬áthis can be achieved by a simple branch or a switch.

Heres an example of a calculation with With MaxWalkspeed.

How can we help?