Hi,
I have searched the forum but with no luck.
My abilities have an Ability Variable called AttackPower which will be used in formulas to calculate the damage.
Let's say the player has learned an ability X, it's AttackPower=100. If the player equip a weapon Y, then the ability X's AttackPower will became 150.
Can I implement this feature with ORK?
  • You put a game var on your weapon, like attackPowerMultiplier, you put 1.5 in your case. Then in your fomula, you use a select equipment node to select the weapon of the user, then you multiply the weapon variable.
  • @UserName Thanks. That's a solution. In fact, I have some abilities match some weapons. Like WeaponX strengthen AbilityX , WeaponY strengthen AbilityY, etc. So I have to set different game var key in different weapons, like XAttackPowerMultiplier in WeaponX, YAttackPowerMultiplier in WeaponY. Imagine player equip WeaponY and use AbilityX, in formula the Select Equipment node game var key will be XAttackPowerMultiplier, but the WeaponY doesn't have the game variable, so the node returns 0 ? Maybe add some value check will fix this problem. Will try it tomorrow. Thanks again :)
  • Yeah, that's pretty much how it works. If a variable isn't set, it'll return the default value, e.g. 0 for a float or false for a bool.

    You can e.g. set up a formula for each of these factors, which'll get the equipment, check the value and return a correct one when the variable isn't set. That way you can reuse the mechanic in multiple formulas without having to set it up again and again :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.