Hi there!
I have an issue with an unwanted error message from the GAS, when a GE with SetByCallerData in applied, without a defaut value.
“FGameplayEffectSpec::GetMagnitude called for Data %s on Def %s when magnitude had not yet been set by caller”
My specific case is that I am applying a GE on an ASC, which applies another sub GE through UAdditionalEffectsGameplayEffectComponent. This is this sub GE which contains a SetByCaller data magnitude.
As the sub GE is created automatically by the first GE, I cannot modify the Spec to fill in a default value for the SetByCaller magnitude.
I have consider doing it in this override, juste before the effect is applied: UBrimstoneAbilitySystemComponent::ApplyGameplayEffectSpecToSelf
But the Spec is const, so I cannot modify the magnitude…
We are now considering the following option:
* Modify the Engine to add a virtual method UAbilitySystemComponet::ShouldWarnMissingMagnitude, and override it in our Asc to test if the GE matches some conditions. And modify UAbilitySystemComponent::ApplyGameplayEffectSpecToSelf to call this method:
Modifier.ModifierMagnitude.AttemptCalculateMagnitude(Spec, Magnitude, ShouldWarnMissingMagnitude(Spec));
Do you see a better option?
Thanks!
Mathieu