Quick answer: Give the function a Return Type (not “None”), call Set Return Value inside it, and invoke it as an expression — Functions.MyFunc() — not as an action.
A “calculate damage” function is supposed to return a number, but the caller always gets 0. The function has no return type set, or it’s called as an action.
Set the Return Type
In the Functions panel, select the function. Set its Return Type to Number (or String). With type “None”, it can never return a value.
Set Return Value Inside
On function CalculateDamage:
Local var dmg = base * multiplier
→ Set Return Value dmg
The Set Return Value action stores the result. Without it, the return is the type’s default (0 / “”).
Call as an Expression
// expression form — captures the return value
Set hp to hp - Functions.CalculateDamage(10, 1.5)
Calling via the Call Function action runs it but discards the return. Use the expression form Functions.Name(params) wherever you need the value.
Parameters by Position
Parameters are positional. Inside the function read them as Function.Param(0), Function.Param(1), etc., in the same order the caller passes them.
Verifying
The caller receives the computed damage. Changing inputs changes the result. Calling the same function as an action (where you don’t need the value) still works for side effects.
“Return type + Set Return Value + expression-form call. Miss any one and you get the default.”
Name pure-calculation functions clearly (‘CalcXxx’, ‘GetXxx’) so call sites know to use the expression form.