Stat to skill ratio

This is a great place to use blueprint functions. Create a blueprint function named SwordSkill(), then in that function take the Floor (a math function) of (Strength+Coordination) / 4. Then whenever you need your Sword Skill value, call the function SwordSkill and it will return an int with your Sword Skill value.

Keep in mind this doesn’t enforce that Strength and Coordination go up evenly, so you would have to enforce that elsewhere, otherwise Strength + 3 and Coordination + 1 will also raise SwordSkill by 1. Personally I would come up with a better system than having Strength and Coordination have to go up by exactly two to raise Sword Skill by 1, but I think you get the idea with the math above. The secret is using the Floor function with your Division (if you want to round down like most gaming systems do).

Almost.

So first you want to add an Output of type int to your SwordSkill function. This will add a return node that replaces the Set Sword Skill nodes in your screenshot above. (setting a variable twice does not work as the last SET always wins).

Then you can’t take Strength and Coordination separately so you need to add them together then divide by 4 instead of 2 and just take the floor of that number and route it to the return node.

Hello,

I would like to setup my skills to be based off your primary stats as well. For example, your sword skill is based off your strength and Coordination. For every 2 points of strength and 2 points of coordination your sword skill goes up one point. Can someone help me with this please?

Something like this?

I just threw this together.

Like this?

That is it exactly!

So as a function it won’t update your Sword Skill variable. Instead it replaces your Sword Skill variable. So go delete your Sword Skill variable and use this function everywhere you wanted to use the Sword Skill variable.

I noticed this is a UMG Widget, so if you need to get the value into some control like a textbox or label you will have to run the function and then transfer the output value to your UMG widget when the widget is opened or displayed or however you use it.

Ok, great! Be sure to accept the answer by clicking on the green check mark by my first answer so others can easily find this solution if they have the same issue you did. Thanks!

Ok, next question, how do I put it in play? I just tested it and it is not updating the sword skill.

This worked, thanks so much!