edited May 2016 in ORK Support
For reference I have read:
http://orkframework.com/tutorial/howto/formulas/ and http://orkframework.com/tutorial/game-tutorial/11-formulas/

I've been given some complex formulas that I'm trying to convert over to ORK formulas and having some trouble as lack of support for parentheses and providing multiple inputs has been a bit problematic.

I guess the TLDR version is - how do you guys handle formulas where you want to provide multiple values to calculate the result?


The long version is below:
I have ground and space battles that use different formulas (and status values). I'm just going to focus on the ground formulas for now, but both of them rely on a RATE equation and a TIERMODIFIER (I'm using Class Level as the tier):
http://puu.sh/oOk0W/abf5d25ee5.png

These equations allow me to do things such as calculating my armor penetration, damage reduction or evasion using different rate curves:

public static float GroundStatMax
{
get { return 10 + 408*TierModifier(); }
}

public float ArmorPenetration(float power)
{
return Rate(power, GroundStatMax, 0.55f, 0.9f);
}

public float ArmorDamageReduction(float armor)
{
return Rate(armor, GroundStatMax, 0.75f, 0.99f);
}

public float EvasionChance(float finesse)
{
return Rate(finesse, GroundStatMax, 0.25f, 0.5f);
}



However because I cannot pass multiple values or specify which stat I would like to use (I would have to write a rate equation for each status value) I'm having some difficulty. Am I going about this the wrong way? Should I use my own formulas to create abilities or somehow have the ORK -> Game -> Formulas call the functions in my code?

So far my formulas (to just solve one Rate equation for HitChance) look like this:
http://puu.sh/oOkfE/1e97df142b.png

And a look into the Finess ground rate equation:
http://puu.sh/oOlYo/0f929ca2c2.png
Post edited by deckrocket on
  • So, I'm not sure if this is the best way to do it but I found a workaround to avoid having to move the formulas into ORK, but still take advantage of ORK triggering abilities/animations/etc..

    Basically I do all my calculations as normal for my abilities (in my code, not ORK), and use combatant.Variable.Set("key", value). Then my ORK function block just gets a Game Variable (the key) to determine what happens (whether it is a hit chance or a damage stat).
  • If the included formula steps and possiblities (e.g. using variables in the calculations) are not enough for your needs, you can always write your own custom formula steps.

    It's crucial to put them in the ORKFramework.Formulas.Steps namespace in order for the ORK editor to find them. It's enough to have the script in your Unity project, no need to add your custom steps to ORK's source code.
    Take a look at the code of the included formula steps to learn what's needed for a custom step. The script files can be found in Gameplay > Base > Formula > Nodes in the code project included in the full version.
    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!
  • Ah very cool, thanks a lot.
Sign In or Register to comment.