[SUPPORT] Advanced Turn Based Tile Toolkit

Hi Arragoth, so for this you can use GetIndexesInRange and spawn the tiles accordingly. In BP_GridManager_Hex you can override the SpawnTileGrid function like so:

https://i.imgur.com/LpCTliG.png

This gives you the visual result you are after:

https://i.imgur.com/ba6qai8.png

However, we are not done, as the gameplay grids need to know that these tiles have to be added to the appropriate arrays at startup.

So we can similarly modify CreateGridLocations:

https://i.imgur.com/wzWwlFo.png

In the above screenshot I’m modifying the part of the function if heightmap is set to false. If you have a different heightmap setup modify the other parts of this function as appropriate.

We’re almost done, but there is one thing missing. To improve performance on very large grids, individual tile mesh instances do not have collision enabled, so they will not block the grid generation traces on startup or the trace under the cursor for interacting with the grid.

Normally this is solved by having a collision plane component that resizes to appropriately cover the grid. We could code something similar with an automatically resizing flat hexagonal mesh, and I might do so in a future update, but for now let us just do it manually, since I’m assuming you know the size of your map beforehand (let me know if this is not the case)

So here I simply place a SM_Hex static mesh on top of our grid manager, resize it as appropriate, set its collision to block PathTrace, and set bHiddenInGame to true:

https://i.imgur.com/xrAoOs6.png

And we’re golden:

https://i.imgur.com/aJEXeHh.gif

Note that there might be issues with this setup that I’m not seeing as I have not tested every feature of the toolkit against this setup. Let me know if you run into any problems. For now it is probably at least smart to set GridSizeY to the same size as GridSizeX to avoid some potential conflicts.