I am developing a grid battle game, and I would like to factor in the element of height for ability range. But the grid shape range in battle ranges template can only be preset, any solution to change it dynamically?

Besides that, how to get a status value from the nearest enemy in schematics? I try to look for nodes to detect targets and choose the nearest target, like how it's done in battle AIs tutorial, but nothing in schematics tab comes close. Have I missed something?
  • Unless your grid shape uses the Check Height Differences settings, the height is ignored.
    Otherwise, you can use conditional ranges in the use/affect range settings of the ability or item to use different range templates based on conditions.

    There are different ways to do it - e.g. using the Select Combatant Objects node (with Store Combatants enabled, otherwise it'll use their game objects) can store combatants with distance sorting. Afterwards you can get the closest combatant (i.e. the first in the stored data) using a Select Selected Data node.
    Alternatives, e.g. for grid-based, is using a Select Grid Cells node (again with Store Combatants enabled to get the combatants from the cells), which can use range templates to define from where to get them. A Sort Selected Combatants node afterwards can sort them based on different conditions, e.g. distance or grid distance. Again, a Select Selected Data node to get the first from 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!
  • Thank you for the tips, now I know how to use Select...nodes better.
Sign In or Register to comment.