# Using Tiled2PkUnity

![](https://2092279756-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LA_MVf8_6s2N5mUApI5%2F-LA_MWSbHn5kvOT8voBX%2F-LA_MXU2h20p92qAirsE%2Ftiled2pkunityhigh.png?generation=1524266576880424\&alt=media)

## Using Tiled2PkUnity

Tiled2PkUnity is meant to replace the 'Pokemon Essentials' part of creating a map in Pokemon Unity. It creates a collision map out of a tilemap made with Tiled, using a tileset with specific variables.

To use this tool, you must first install the [Tiled Map Editor](http://www.mapeditor.org) and the LTS version of [Node.js](http://www.nodejs.org).

The application itself is located in the 'TOOLS/Tiled2PkUnity/' directory.

## Tiled

In order to use this application, you need a tileset with specific values to specify what tiles do what. There are premade tileset JSONs in the 'TOOLS/Map Texture Tilesets' directory.

Simply create a tileset directing to your image source, and select all tiles, then click the plus icon in the bottom left corner and add an int property named "Type".

Now that you have set up the tileset, you can now select tiles and set the values accordingly. Here is a sheet of the values used for collision:

* 0
  * Floor/Non-collidable
* 1
  * Wall/Collidable
* 2
  * Water/Surfable
* 3
  * Environment 2 (Used for having different environments during battles in the same map)

Once you're completed, save the tileset as a 'JSON Tileset File (*.json*)'.

After you have set up your tileset, you can now proceed to creating your tilemap. Once created, head to 'Map>Add External Tileset' and add the tileset you'd like to use, do not use more than one tileset! After the tileset is added, embed the tileset into the map:

![](https://2092279756-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LA_MVf8_6s2N5mUApI5%2F-LA_MWSbHn5kvOT8voBX%2F-LA_MXX0amaTk3YnDNYE%2Fembedtileset.png?generation=1524266576866048\&alt=media)

Once the tilemap is complete, save the tilemap and proceed towards making the collision map.

## Launching the app

Once Node.js is confirmed to be installed, drag and drop your tilemap JSON onto the Launch.bat inside the Tiled2PkUnity directory.

Afterwards, your collision map should be in a text file with an '\_cmap' suffix, but only if you have the 'fs' module installed. If not, the collision map will instead be outputted into the command prompt.

Copy this collision map and paste it into the MapCollider on your Pokemon Unity map and test the game to make sure it works properly. If not, try setting some offsets and make sure your width and height are set correctly. Thanks for using Tiled2PkUnity!

Arguments:

`node tiled2pkunity.js ./Tilemap.json [Output.txt]`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pokemonunity.gitbook.io/pokemon-unity/using-tiled2pkunity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
