I’m looking to create a conditional GE that will only be applied if the level of the original GE is at level 2.
Currently something similar exist with the property
ConitionalGameplayEffects. However, there is no level restriction on it.
Looking at the source code:
bool FConditionalGameplayEffect::CanApply(const FGameplayTagContainer& SourceTags, float SourceLevel) const
// Right now we’re just using the tags but in the future we may gate this by source level as well
As you can see, there is even a comment in there. The only thing left is:
- Add 2 properties to
float MaxLevel. Should be default initialized to -1 to be backward compatible.
- inside :CanApply(), replace the condition with this:
return SourceTags.HasAll(RequiredSourceTags) && (MinLevel < 0 || MinLevel <= SourceLevel) && (MaxLevel < 0 || SourceLevel <= MaxLevel);
Also note I tried to create a class derived from UGameplayEffect and implement it for my project only, but there are too many non-virtual methods to achieve that.