Hi! Can GAS to multiply the duration effect mods and not adding each other? When I apply few same effects with multiplication modifiers the formula looks like this:
AttributeValue * (Mod + Mod + Mod + Mod + …)
I need something like:
AttributeValue * Mod * Mod * Mod * Mod * …
The instant effect do it correct, but not with duration. I tried any parrameters, I was revising the GAS source code and tried to find maybe delegates ot some virtual functions for solutions, but not find any options how to multiply mods. Сan this be solved somehow?
Have you looked at UGameplayEffectExecutionCalculation you can reference it in the CustomCalculationClass and it can take multiple attributes that you can do whatever you like with there’s a good write up here and and excellent implementation example in the source code.
Thanks for the answer. But UGameplayEffectExecutionCalculation not called for effects with durations no period, because there is check in source code:
// Should only ever execute effects that are instant application or periodic application
// Effects with no period and that aren't instant application should never be executed
check( (Spec.GetDuration() == UGameplayEffect::INSTANT_APPLICATION || Spec.GetPeriod() != UGameplayEffect::NO_PERIOD) );
If you have a single effect with multiple mods that multiply the same attribute, it should yield the same result. Maybe I’m not understanding what you are saying.
If your attribute starts at 10, and you multiply it by 2 three times, you get 80, no matter whether it’s
Oh… Sorry, you write multiplemods in first message. I misunderstood. No, I want one effect with only one modifier, because I want apply this effect multiple times consistently.
Hi, I found a solution to this problem and thought I’d share. I also wanted Attribute * Mod * Mod and not Attribute * (Mod + Mod) and there are 2 ways you can go about it.
The first and most intrusive way is to make the engine change suggested here and change FAggregatorModChannel::EvaluateWithBase() so that the default behavior is what you want.
The second way is to use the evaluation channels that were released in 4.14, that for some reason aren’t discussed or documented anywhere. You just need to edit DefaultGame.ini and add the following:
By default, there are 10 channels available. After you add that, your details panel in the editor will show only the channels that you give names to in the ini file.
Then, you can select the appropriate channel and do something like: Attribute * (MyFirstChannelMod + MyFirstChannelMod) * MySecondChannelMod!