edited April 2014 in ORK Support
Iv'e been working with variable more heavily and there are a couple things I was kind of confused by.

-What is the purpose of the Define Variables section under Game Variables in the Editor tab?

-Could you explain what an object variable is and how it differs from a normal variable?

Also I had one other question unrelated to variables. How do I raise or lower Defence attributes with status effects. Say I want to make a status effect that increases my resistance to ice damage, how do I do that?

Thanks!
  • The Define Variables settings are used to, well, define some variables :)
    They aren't automatically used or initialized in the game, it's just a convenience function for the editor, to create some variable names/keys to be used in the different variable field dropdowns (the button beside variable key definitions).

    An object variable works just like the other variable. The difference is, that a global variable is globally available at any time, while an object variable is bound to a game object in your scene (and thus requires an Object Variable Component attached).
    The idea behind object variables it to allow adding information to objects, e.g. to set different states to a combatant to be used in the battle AI, or having a local counter on an NPC without the need to define a global variable key for it - which can be quite difficult if you're building a large game, just imagine you'd have to find a unique variable key for each NPC in your game, while with object variables, they wont interfere with each other.

    Status effects can change attack and defence attributes through bonuses - you can either define a Custom Bonus right in the status effect's settings, or use a defined status bonus out of the list.
    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!
  • Cool that really clears things up, Thanks! One more thing, under value type I'm a little fuzzy on what game variable option is. What's the difference between value and game variable?
  • The value type defines where a value will come from - in case of the variable key:
    - Value uses the text you defined as variable key
    - Game Variable uses the text you defined as the variable key of a game variable that contains the variable key you're using :)

    You can find more details in this how-to.
    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.