Add a new Status Attributes (Stat Bonus)
Last updated
Last updated
Files used: E_ItemStatBonus, S_Stats, BPC_RPGSystem
Open the E_ItemStatBonus and add a new entry called by your new stat.
Open the S_Stats and add a new variable
Choose the correct Data Type, you can even create a new structure and add more variables if needed, you're not forced to use a float (The Life leech stat bonus is using a structure as an example)
Open the BPC_RPGSystem and find the ‘StatTemplate’ function.
Duplicate it, name it correctly and open it.
First of all, we need to change the enum of the ‘GetStatBonus’ node to our new one and in the ‘Set Member in S_Stats’.
This will set the MyNewStat base on all Stat bonuses of your own stat.
Open the ‘CalcStatusStats’ function, and go to the switch based on the E_ItemStatBonus.
Depending on how you want to use MyNewStat you need to place the function in a different case on the switch. (Take a look at the Vitality case)
Open the ‘GetStat’ function and add a return node for your ‘MyNewStat’ Bonus. (In this case, it’s a percent-only value, take a look into the other stats with Integer and Float values)
Congratulations! You added your first own Stat bonus.
Now to get your new Stat visible in the Status Info UI you have to open the ‘BPL_RPGSystem’. Go to the ‘GetSettings’ function and select the ‘DefaultSettings’ local variable.
Add your stat to the ‘StatBonusCategories’ list to make it visible. You may want to add it also to the other lists.
Done!