edited August 2020 in ORK Support
Hello Everyone,

Hope this post finds anyone who reads this well. I have a question about formulas/events. From what I've tried so far, I don't see a way to compare a selected data variable and an object variable. This is my use case:

I'm building a STAB (Same Type attack bonus) system like Pokemon. If the ability type matches the type of the combatant, the base damaged in multiplied by 1.2. Right now I have two formulas:

attack base formula
magic base formula

One of the above will be used as input to another formula that is trying to get a game variable attached to the ability calling the event + formula. I can get this no problem via selected data in my "Check Game Variables" node. However I cannot seem to figure out a way to compare this to a game variable attached to the user. This is the variable setup:

the ability has a game variable called "abilityType" (Grass, Water, Fire, etc)
the combatant (user) in the event has a game variable called "combatantType" (Grass, Water, Fire, etc)

I can do the obvious check directly to a string value, but I cant seem to get to to check the value of combatantType. The "Check Game Variable" node uses a variable origin of selected data with the keyword action, but the comparison against a game variable never seems to work. I've tried using a variable to variable node to move the object variable to a local to use in the formula, but nothing seems to be working. Am I missing something obvious here?

I'd rather not have to do explicit checks for every element because I have two damage types and 12 elements so far. On top of that, all abilities can critical so I would need a critical hit formula for all elements across both damage types and that is just starting to get unwieldy.

Side note: I feel like it would be slightly streamlined if I could just set the defense attribute ID to a variable. That's all my combatantType variable is anyway, but I don't see an option to do this.

Here is what the formula looks like with the check to the local type:
image

And here is the log I get when I use an ability with the formulas and event:
image
In my check variable step, I'm writing to the log just to see if the localCombatantType (from Variable to Variable) is working. It seems like it doesnt work, then suddenly it recognizes the equality to "Robot".

Apologies that this was so long winded. Perhaps I'll figure out the solution tomorrow now that I've written out what's going on. It might just be easier to write my own formula steps at this point to directly compare what I need.
Post edited by Juupo on
  • Yeah, the game variable checks are limited to using global variable values, i.e. in your check, you're checking what's in the global actionType and localCombatantType variables.

    An easy fix would be setting the global variables before the formula is used (e.g. before the Calculate node in your battle event) with a Variable To Variable node.
    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!
  • Thanks as always GIL. Didn’t know that about game variable checks but I’ll give it a go shortly. Cheers.
  • This worked! Thanks again :)
Sign In or Register to comment.