Hi!

This is probably very simple to do, but I haven't been able to figure how to do this with the nodes in the Battle AI.

I have an enemy that uses a different skill depending if the global turn is even or odd (in a phase battle). I'm tracking the turn number through a variable.

So in the enemy's Battle AI, I have tried to play with the Check Variable node. I tried to check if Modulo 2 would return 0 or something else, but I can't find the modulo function. I have also tried to create a Formula (using the variable as the initial number) and to check the formula result in the Battle AI... but I haven't been able to figure out how to do that with the nodes in the Battle AI.

I've also tried the Check Turn node, but since it checks the turn number of the target, I'm sometimes having inconsistent results if the character arrives on the field on an even turn, or if it was revived.

Thank you!
  • Generally, using a formula you can use a Value node with the Modulo operator to do this. So, since it's a global variable, you can just:
    - Value node to set the formula to the global variable's value
    - Value node with Modulo operator and a value of 2

    Though, battle AI's don't have a Check Value node to actually check the formula result directly - I'll look into it.
    However, you can store the formula result into a local variable (Change Variables node) and afterwards check the variable (Check Variables 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!
  • Aaah yes, I can simply do the modulo calculation in the Player Phase Start schematic, at the same time I update the turn count, then check the result later in the Battle AI.

    I was so focused on looking how to do a modulo in the Battle AI nodes that I didn't think of this simple method!

    Thanks :)
  • Next update will add some new stuff - a modulo math function and Check Value node for battle AIs.

    There'll also be new nodes to check the battle turn, i.e. the combatant-independent turn counter of the battle system.
    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!
  • That's awesome :)

    Thank you!
Sign In or Register to comment.