void Func() const;
There is no
const modifier or equivalent.
Is there anything in particular that you are trying to accomplish?
Since SkookumScript is used for high-level scripting, it is more streamlined to ensure that scripters do not get lost in the details.
It is possible that the language could be extended to have some sort of constant construct in the future, though there are no plans to do so at the moment.
Some functions like
UGameplayModMagnitudeCalculation is const.
When i create a method, then used after the
CalculateBaseMagnitude in Bluprint and receive it’s parameters, compile error occurred.
I had to created in c++ instead of this.
If any of our generated code including generated binding code gave errors then that might be something that needs to be fixed.
Could you please give us some example code and Blueprints that seem to be giving you trouble? Then we can see if we can fix things on our end so you don’t need to write special C++.
I’m glad you were able to get around the problem yourself though.
Of course. Here’s my experience:
Create a blueprint
UGameplayModMagnitudeCalculation. I’ll use it to evaluate the attack damage of character.
Create a blueprint
UGameplayEffect, then add a Damage
Modifier, set the
CustomCalculationClass, use just created
I tried to override
BP_DamageMMCin SkookumScript, left the blueprint set not override, but it won’t invoke in testing, not when i overrode the blueprint side either. Maybe i misunderstand the override in SkookumScript. So i tried another way then.
Create a method in
BP_DamageMMCfrom SkookumScript side, called
calculate_damage, has the same parameter with
const UGameplayEffectSpec& Spec, which does the real evaluate things. Then i overrode the
ClaculateBaseMagnitudein blueprint, it invoke the
calculate_damage, pass the
Specto it. When compiling the blueprint, error came out. Since
ClaculateBaseMagnitudeis const function, but
calculate_damageis not. That’s the reason i posted this question. Then i found another way.
If i create
calculate_damagea static method, it will compile. but this cause the game crash. So if the method take the
Specparameter, either compile error or game crash occurs.
That’s all. (for test case, i used SkookumScript to let character’s
GameplayEffect to itself directly by
At last i wonder how to actually override the c++/blueprint function in SkookumScript, and will they be invoked after override if there are some code invoke them from parent class pointer in source code of engine?
Hey sorry for the late reply: So first of all, SkookumScript currently does not currently support the overriding of BlueprintImplementable event functions. So what you did is the correct workaround.
To address the issues you were experiencing using your workaround, we pushed a fix to GitHub that should allow you to call SkookumScript functions from const Blueprint functions, and it also fixes the crash you were experiencing using the static method. Let us know how it goes!