reznok / GMCAbilitySystem

An Unreal Engine plugin that adds an ability system to the General Movement Component plugin
MIT License
28 stars 13 forks source link

Add a "Remove All Active Abilities By Class" method on the ASC #16

Open LeoFabre opened 4 months ago

LeoFabre commented 4 months ago

Title says it all ! Can be useful to have if you activate several abilities that are children of the given class for example.

I might implement this myself later, leaving this as a TODO :)

reznok commented 4 months ago

Similar to GAS, I was planning on adding a way to remove abilities by tag. I believe GAS has a property for Effects that's "Cancel Abilities With Tag".

Packetdancer commented 2 months ago

This should actually be closed out, as RemoveEffectByTag has been in place for a while now!

Packetdancer commented 2 months ago

Wait, I misread this, it's ability and not effect. :|

Aherys commented 2 months ago

Implemented in https://github.com/Aherys/DeepWorlds_GMCAbilitySystem/commit/d814d9ca139bac64ef2d411c48f129ece4b5d988

Aherys commented 2 months ago

Is now PR #64

LeoFabre commented 2 months ago

Is now PR #64

Very cool, thanks !

LeoFabre commented 2 months ago

Looking at the code, it looks like it's by tag and not by class, but actually having it by tag is more powerful.

Aherys commented 2 months ago

There is both.


    UFUNCTION(BlueprintCallable, DisplayName="End Abilities (By Tag)", Category="GMAS|Abilities")
    // End all abilities with the corresponding tag, returns the number of abilities ended
    int EndAbilitiesByTag(FGameplayTag AbilityTag);

    UFUNCTION(BlueprintCallable, DisplayName="End Abilities (By Class)", Category="GMAS|Abilities")
    // End all abilities with the corresponding tag, returns the number of abilities ended
    int EndAbilitiesByClass(TSubclassOf<UGMCAbility> AbilityClass);```