For my RTS game I’m looking for a good attack ability system by following the known RTS attack rules.
I tried implementing a system with the gameplay ability system but it seems off.
The flow is this:
Right click to tell the unit to attack the enemy
The unit should move to the specified attack range
Once reached, loop the attack ability
The loop should utilize the ability cooldown so it won’t loop forever.
If another order has been given, like move, cancel the attack ability.
If attack order been given again, move to the attack range, and wait for the cooldown to finish so it would loop again this logic.
The problem is that gameplay ability cooldown is preventing me from running the ability again once I cancelled it. But I still want the unit to at least move to the attack range location (radius) and wait for that cooldown to run the ability again.
While also not creating multiple instances of the same ability but utilize only one if exist.
I can’t wrap my head around this system and find a robust solution like any other RTS game.
Yes, the problem would be that I would need to create double ability files for each attack ability because gameplay ability can’t take inputs from outside.
Is this is the case, in an ability, you can get a reference to the calling ability system, from there the actor. If you setup a UI widget for setting an “active ability” soft references for an ability on the actor, you could then call that in the ability BP
Just diving to State Tree and I’m so confused about it.
Thought maybe the simple action of “Move” can still be called from GA because the StateTree MoveTo task needs to wait and finish before I can tell him to move to a different location.
Just the Move+Attack will drive from StateTree.