For a turn based battle I'd like some enemy combatants to follow a turn order rotation to determine which abilities to use. I see in the battle ai there are "Check Turn" and "Check Turn Value" nodes, the former even includes a "Every n Turns" option, however I don't see how that would allow me to implement, for example, a 3 turn rotation like: on Turn 1 use Ability A, on Turn 2 use Ability B, on Turn 3 use Ability C, then on Turn 4 start the rotation again using Ability A.

For now I set a global variable and use a Game Variable Fork, which is okay if there is a single instance of that enemy in a scene, but gets more complicated if there are multiple (i.e. I don't want multiple enemies using the same turn count). Can you confirm Game Variable Fork just uses global variables?

If this isn't supported I can make do, but am curious if something like this might be supported in the future. Thanks for your help.
  • Should be doable with the Every n Turns option, but use it in reversed order, i.e. highest to lowest, so first check for every 3 turns, followed by every 2 and finally every 1.

    Otherwise the every 1 turn would kick in every time :)
    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 makes sense. I'll give it a try thanks!
  • Hey unfortunately this does not appear to work. Given a 5 turn rotation, on the 6th turn it will loop back to "every 3 turns" action. I'm going to just resort to a local variable. In the past I've used a "rotation count" to act as the modulo to which the turn count is calculation against but I realize that's more complicated. Thanks for your help though.
  • Ah, yeah ... that can result in issues when exceeding a small amount of actions to rotate through.
    An object variable on the combatant to count through the actions is the way to go in that case.
    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.