GAS recharge ability with multiple usages/charges

I want to implement a Dash ability with the following behavior:

Attributes

  • DashCharges: current available charges
  • MaxDashCharges: number of max charges available
  • DashChargesCost: how many charges are consumed per use
  • DashChargesRegenTickrate: timer rate how fast charges are recharged
  • DashChargesRegen: how many charges should be recharged per DashChargesRegenTickrate

The issues

  • DashChargesRegenTickrate: this may change via GE but the period for infinite GE cannot be attribute based. Hence I most likely have to start my own timer-loop? I’ve tried different approaches but all seem very awkward. My final solution was a looping timer (DashChargesRegenTickrate) that executed an instant GE which adds attribute DashChargesRegen to DashCharges. However this approach keeps recharging even if the charges are full which leads to the issue below.
  • The regeneration should only start when the current charges are < MaxDashCharges. I tried to work with the cooldown feature here but the GE stops after one execution and I had some other unwanted behavior as well.

I feel like an ability with multiple charges is a common case so I hope I just use the GAS wrong or is it not possible to do this out of the box?

Hey there @Khorne1337! Welcome back to the community! So GAS has support for stacking GameplayEffects but not so much a built in system to stack ability charges. Some developers like the one linked below have implemented their own ability stacking behavior:

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.