Update to clarify: I am using the Unreal Gameplay Ability System (“GAS”) in Unreal 4.26. This is specifically a question about how to best configure the components that already exist in that system: GameplayAbility, GameplayEffect, and GameplayCue.
Let’s say I have a “Gather” gameplay ability.
Depending on where the Pawn is, it will Gather blueberries, or hay, or mushrooms, or …
The animation is the same, the “I can’t attack while gathering” and all the rest of the integration is the same, but two things differ:
- The GameplayCue that floats an icon of the resource into the pawn inventory should use a different icon
- The GameplayEffect that adds resources into the pawn inventory should add a different resource type
The straightforward way of implementing this is to create a separate gathering gameplay effect for each resource type, and configure them differently in only these two areas, and then pre-select and start the appropriate ability when the time comes. The draw-back with this is that these abilities may diverge over time – if I add some immunity or blocker tag to one of these effects, I need to remember to add it to all the effects.
Is there some other way to pass parameters into a gameplay abiltiy, and from there to to effects? There’s the more-or-less pre-defined targeting info / activation info structs, but they don’t have appropriate values for my “icon image” and “resource type” properties. The best way I can find to maybe make that happen would be to apply a transient target actor, that serves as a stand-in object that in turn contains the appropriate properties.
Is there a third, better, way, of accomplishing what I want, that I’m missing?