Using UTilemapBlueprintLibrary

Hello,

Just for some background information I’m trying to do procedural generation to create the level for my 2D top down game. What I want to do is get the UPaperTileMapComponent on my actor ALevelGenerator and change the tiles to represent my dungeon at runtime using some dungeon generation algorithms.

So on my MapGenerator class I have created the UPaperTileMap and UPaperTileMapComponent and attached these to the root component and everything appears correctly in my level. The issue I’m running into is with the function DungeonTileMapComponent->SetTile();

I’ve looked through the documentation and saw that I need a FPaperTileInfo for SetTile. After a lot of searching I found this blueprint library which has a function MakeTile() which returns an FPaperTileInfo. The issue I’m having is how to call this. I’m still fairly new to c++ so that may be my issue. I have added #include “TileMapBlueprintLibrary.h” to the top of my MapGenerator.h file.

I’ve tried to access it as UTileMapBlueprintLibrary::MakeTile(), I’ve also tried to create a pointer to it such as a UPROPERTY() UTileMapBlueprintLibrary* TestLibrary and access the function that way. However, each way I get the same error message:

error LNK2019: unresolved external symbol “public: statick struct FPaperTileInfo __cdecl UTileMapBlueprintLibrary::MakeTile(int, class UPaperTileSet *, bool, bool, bool)”

Any ideas on how I’m supposed to access this to set an idividual tile for the tile map? Any help would be greatly appreciated!

FPaperTileInfo is a struct so you dont need to construct it or get anything, just do local varable (or place it in class if you will needed it in future), set variables you need in it and you are set:

FPaperTileInfo TileInfo;
TileInfo.TileSet = MyTileSet;
FunctionThatUsePaperTileInfo(TileInfo);

Look up API refrence:

Thanks a lot that actually helped!