[SUPPORT] Advanced Turn Based Tile Toolkit

I assume the issue is not with loading maps, right? That can be used with UE4’s regular nodes for loading maps. Do you want an overworld map that also uses the grid manager to create a grid-based overworld where you can click tiles to load maps?

There are several ways to do this, and what is best depends a lot on your game. You could use a new feature I added in the last patch which is the GridObjects map. GridObjects is a map type variable in BP_GridManager which is used for storing any object on the grid which is not a unit and which you do not want to create an entire new map for. This is a map of nested object arrays, meaning you can store any number of objects on each tile of the grid. One such object could hold a reference to the map you want to load.

To add an object to the grid use the AddObjectToGrid function. If the object you add implements the BPI_Interact interface you can use the InteractWithObjects function (also in BP_GridManager) to interact with it.

So first create blueprints based on the BP_GridActor class. Add a variable specifying a certain map. Implement the BPI_Interact interface and create an interact event using the interface. When it is called, have it display your load map UI (this could be from a widget component held in the actor itself).

Place your map reference actors around on the map. On EventBeginPlay for your map reference actors get a reference to BP_GridManager and call AddObjectToGrid, adding itself to the grid index held in the GridIndex variable (which your new actor should have, since it is based off GridActor).

Now if you call the InteractWithObjects function specifying the grid index of a tile containing your map actor (remember that you can convert a location to a grid index with the ConvertIndexToLocation function if needed) you will display your UI widget.

To call the InteractWithObjects event when a unit ends its movement on a tile we would want to use the event dispatcher which is called when units ends movement. There are two of these, one for simulation and one for animation. We want to use the one for animation, as we want the UI to be displayed when the unit appears to end its movement to the player, not when it is simulated as such on the grid (which happens immediately after the player clicks to move). So bind an event in the grid manager to the OnUnitEndMovementAnimate event dispatcher. Have it call the InteractWithObjects function using the grid index output of the dispatcher as its input and you should be golden.

There are quicker and dirtier ways to do this stuff, like just using collision boxes and such, but I thought I should explain this here as it is a generic solution that works with all sorts of stuff (I use it for equipping weapons and armor in the 2D example map, for instance). Hope my explanation is not too confusing. This is one of the things I really want to make a tutorial on once I find the time.