edited March 5 in ORK Support
I'm trying to make a turn-based battle system with a fixed formation i.e. front row and back row. I followed the 2D Grid Battle guide to set up the grids. However, instead of letting the player pick, I want to auto-assign the combatants based on battle group index.

I see that there is an option on the grid cell: Preferred Member Index. I assume that this works with the Place On Grid schematic node to move the spawned combatants into their respective positions. However, it seems that this node does nothing - combatants are left at where they spawned, and inspecting the grids in the scene showed all of them empty.

Am I missing something here?
Post edited by Flying_Banana on
  • I assume you have Use Deployment Cells enabled in your Place On Grid node, and the grid cells you want to use are set up as deployment cells?
    That setup should go through all deployment cells and get the nearest one for the member index - if none is found that way, it'll get the nearest one ignoring the index.

    You could try destroying the game objects first and using a Spawn Battle Combatants 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!
  • edited March 5
    I think I have everything set up correctly, but nothing is happening :/

    Here's my start battle schematics (I added the player selection to test that out, but that also doesn't do anything, removing it doesn't make things work either):

    image

    And here's my deployment cell:

    image

    Strangely though, in the scene the P and E are all dark gray:

    image

    I did manually move the grid cells a bit and it no longer matches the setting in the Battle Grid Settings, but that shouldn't impact combatant placement, right?
    Post edited by Flying_Banana on
  • edited March 6
    I think I found out which step went wrong. I downloaded the sample Grid 2D Battle project and instead of starting the battle with the NPC I added a random area encounter and a load scene node in the Start Battle schematic, and that resulted in the combatants not being placed on the grid.

    If I instead add the grid in the Town scene with the random encounter, then stuff works. So it must be something in the load scene that prevents the game from executing the grid logic somehow.

    I added a wait after loading the scene but before Place on Grids, but it still fails. So it can't be due to the game not finding the grid.
    Post edited by Flying_Banana on
  • The difference is when the battle is started.
    The 2D Grid Battle project has the battle start in the new scene, so it's already automatically set up with the grid based on it's settings, i.e. finding the nearest grid on battle start.

    If you start the battle in the old scene and load into a battle scene, you need to manually set/search the grid in your battle start schematic. I.e. after loading the new scene, use a Set Battle Grid node to do that.
    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 was it!! Thank you! :)
Sign In or Register to comment.