#i have a few more suggestions
1 messages · Page 1 of 1 (latest)
and ofc we can get the ASC from the effect itself
Cause theres some cases where in BP it shoves out the activeeffect not just the handle
let me show you an example
the returned value here is the Effect not the handle
and its pretty useless in BP
like there is nothing
except my one
so i had to add cpp /** Returns the handle for an Active Effect. */ UFUNCTION(BlueprintPure, Category = "Ability|GameplayEffect") static FActiveGameplayEffectHandle GetHandleFromActiveEffect(const FActiveGameplayEffect& ActiveEffect); this just returns ActiveEffect.Handle;
to be able to get the handle so we can do stuff in this function
then it allows more usages without needing more functions
again doesnt return handle
but the FActiveGameplayEffect
making it useless in BP.
wrong node
this one
FGameplayEffectContextHandle UDominanceAbilitySystemComponent::GetEffectContextByActiveHandle(const FActiveGameplayEffectHandle& ActiveEffect)
{
if (ActiveEffect.GetOwningAbilitySystemComponent())
{
const FActiveGameplayEffect* EffectFound = ActiveEffect.GetOwningAbilitySystemComponent()->GetActiveGameplayEffect(ActiveEffect);
if (EffectFound)
{
return EffectFound->Spec.GetEffectContext();
}
}
return {};
}``` is also really crucial
cause you have no way in bp to get the context
meaning you cant do things like this
/** Returns the Effect Context Handle for an Active Gameplay Effect */
UFUNCTION(BlueprintCallable, Category = "Ability|GameplayEffect")
static FGameplayEffectContextHandle GetEffectContextByActiveHandle(const FActiveGameplayEffectHandle& ActiveEffect);
/** Returns the Active Effect from the Handle */
UFUNCTION(BlueprintCallable, Category = "Ability|GameplayEffect")
static FActiveGameplayEffect GetActiveEffectByEffectActiveHandle(const FActiveGameplayEffectHandle& ActiveEffect);
/** Returns the handle for an Active Effect. */
UFUNCTION(BlueprintPure, Category = "Ability|GameplayEffect")
static FActiveGameplayEffectHandle GetHandleFromActiveEffect(const FActiveGameplayEffect& ActiveEffect);
``` ```cpp
FActiveGameplayEffectHandle UDominanceAbilitySystemComponent::GetHandleFromActiveEffect(const FActiveGameplayEffect& ActiveEffect)
{
return ActiveEffect.Handle;
}
FGameplayEffectContextHandle UDominanceAbilitySystemComponent::GetEffectContextByActiveHandle(const FActiveGameplayEffectHandle& ActiveEffect)
{
if (ActiveEffect.GetOwningAbilitySystemComponent())
{
const FActiveGameplayEffect* EffectFound = ActiveEffect.GetOwningAbilitySystemComponent()->GetActiveGameplayEffect(ActiveEffect);
if (EffectFound)
{
return EffectFound->Spec.GetEffectContext();
}
}
return {};
}
FActiveGameplayEffect UDominanceAbilitySystemComponent::GetActiveEffectByEffectActiveHandle(const FActiveGameplayEffectHandle& ActiveEffect)
{
if (ActiveEffect.GetOwningAbilitySystemComponent())
{
const FActiveGameplayEffect* EffectFound = ActiveEffect.GetOwningAbilitySystemComponent()->GetActiveGameplayEffect(ActiveEffect);
if (EffectFound)
{
return *EffectFound;
}
}
return {};
}
``` these 3 helpers expose a lot more in bp
I'll have a look on Monday but thanks for sharing with the screenshots!
Yeah the nodes that return some handle and then you can't do anything with the handle are so limiting. So I would love to improve that in the engine.
i can make a PR with some stuff which are very useful, to avoid some BP limitations
^ Just wanna let you know I do plan to get around to these, but some things popped up