[SUPPORT] Advanced Turn Based Tile Toolkit

Sorry about the very late reply, people. Was busy all weekend.

Hmm, not entirely sure if I know what you’re saying here. What do you mean with “on pawn initiative” and “pawn with the initiative”? Do you mean that when a new unit is selected that is not controlled by the client, the camera focuses on this unit instead of staying focused on the unit specified as that client’s hero unit? How precisely do you want the end result to behave?

Sure, that is possible. Having it block visibility for finding tiles in range is easy. Just add collision to the corner thingy and have it block the RangeTrace trace channel.

Pathfinding is a bit more difficult. You essentially need to remove the edges from each of the surrounding tiles that pass through the corner where your actor is placed, and then re-add them when the actor is moved.

Since your corner actors always have a straightforward relationship with the surrounding tiles you can make this simpler by hardcoding it. The grid indexes of the surrounding tiles relative to the corner actor will depend on how you chose to offset the actor, but if it is offset to the south-east (positively on the X and Y axes) the surrounding tiles will have relative grid indexes 0, 1, 1000 and 1001. You could go through these tiles in the GridEdges TMap and use RemoveEdgeBothWays on two of the tiles to remove the diagonal crossing through your corner actor. If you have offset the actor as described above you will run RemoveEdge with the following parameters:

RemoveEdgeBothWays(GridIndex,GridIndex+1001) & RemoveEdgeBothWays(GridIndex+1000,GridIndex+1).

When your corner actor is moved or destroyed you would run AddEdgeBothWays with the same inputs.

Note that this will only affect RunPathfinding and FindTilesInRange the next time these are called. If you have a currently active unit displaying move or sight range when you make these changes, you need to re-run pathfinding/visibility for it to take effect.

Should be as simple as using SpawnActor. The construction script of BP_Unit has exposed variables where you can decide if the unit is to be automatically added to the grid and/or initiative order.