# Possible to uniquely identify tiles? And possible to move already-placed tiles in batch?

**URL:** <https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285>\
**Category:** Uncategorized\
**Created:** [August 3, 2023, 8:36pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285 "2023-08-03T20:36:17Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eonova](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@Eonova](https://discourse.mapeditor.org/u/Eonova)\
**Post date:** [August 3, 2023, 8:36pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/1 "2023-08-03T20:36:17Z")

</div>

I’ve created a collision overlay layer, which makes it easy to make the change in my Tiled GUI and have my own code that handles any inputs. However, what if I have a specific tile that should have an action attached to it? Or even a door that I want to uniquely identify and link to another map/door? Is there a way to “mark” that tile so that my code can distinguish it? I can distinguish some tiles from one another with the IDs that the json file spits out, but I want even more granularity.

Also, is there an easy way to drag tiles that you’ve already placed? I have been using the offset map functionality on highlighted parts but it’s not intuitive.

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [August 3, 2023, 8:41pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/2 "2023-08-03T20:41:57Z")

</div>

Objects or additional Tile Layers can be used to mark specific spots as having particular properties.

You can’t drag tiles, but you can cut+paste them. There is this [scripted Move Tiles Tool](https://github.com/eishiya/tiled-scripts/tree/main/Move%20Tiles%20Tool), but it’s not really more convenient than cut+pasting.

---

<div class="post-metadata">

**Author:** ![Eonova](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@Eonova](https://discourse.mapeditor.org/u/Eonova)\
**Post date:** [August 3, 2023, 10:19pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/3 "2023-08-03T22:19:09Z")

</div>

That’s perfect. Can I select an any sort of square pattern or only rectangles? I can across the rectangle selector tool.

Custom properties look great as well. is there a way to apply the same label quickly to all the same tiles? Maybe “tree” for all trees that I place all and in the future. Also is it possible to have an array as a custom property? Like what would be my best option for storing a list of “messages”? I suppose I could use a string and create my own delimeter.

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [August 3, 2023, 10:41pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/4 "2023-08-03T22:41:42Z")

</div>

In addition to the Rectangular Select, you can also use the Magic Wand and Select Same Tile tools to select based on existing tiles. With the various modifier keys, you can add, subtract, and intersect to create more complex selections.

If you want a property to _always_ be on _all_ instances of a particular tile, the intended way is to assign that property to the tile itself, in the tileset. If you want it on all instances just in the current map, if you’re using tiles for the extra data, you can use Select Same Tile and then fill the area with your data tile on another layer. If you’re using Objects, there’s no easy way, but if you don’t want to place the Objects manually, you can use Automapping to output Objects wherever those tiles are found.

Array custom properties are currently not supported (but that is a planned feature). For now, you can use a string property, or multiple properties with array-like names (e.g. prop[1], prop[2]) that you can parse into arrays in your game.

---

<div class="post-metadata">

**Author:** ![Eonova](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@Eonova](https://discourse.mapeditor.org/u/Eonova)\
**Post date:** [August 4, 2023, 9:49pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/5 "2023-08-04T21:49:23Z")

</div>

Thanks you, I will give all of this a try

---

<div class="post-metadata">

**Author:** ![Eonova](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@Eonova](https://discourse.mapeditor.org/u/Eonova)\
**Post date:** [September 11, 2023, 9:52pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/6 "2023-09-11T21:52:33Z")

</div>

![image](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/7/7b92a2b473f9b039e23bd0363174e80908737d14.png)

In order to do what you’re saying, I’ll need to use the custom types editor right? For some reason it’s grayed out for me.

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [September 11, 2023, 9:58pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/7 "2023-09-11T21:58:51Z")

</div>

You **do not** need custom types to do anything I wrote above. What I described uses custom **properties** , not custom types.

To answer your implied question though: it’s greyed out because you must have a Project to store the custom types in. But you don’t need this, you can assign the properties to the tiles/objects/whatever in the Properties panel. Custom **types** are for when you want to define complex property types or set default values for particular classes.

---

<div class="post-metadata">

**Author:** ![Eonova](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@Eonova](https://discourse.mapeditor.org/u/Eonova)\
**Post date:** [September 11, 2023, 10:08pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/8 "2023-09-11T22:08:03Z")

</div>

Apologies, conflated terms and my needs. If i select a tile, the property column on the left updates but is grayed as well

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/1/1661150a113972f310f893a81d20341c21178bdd.png)

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [September 11, 2023, 10:09pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/9 "2023-09-11T22:09:20Z")

</div>

You can only edit tiles in the Tileset Editor. While you’re in the Map Editor, the properties are greyed out.

---

<div class="post-metadata">

**Author:** ![snaidamast](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/snaidamast/32/3841_2.png) [@snaidamast](https://discourse.mapeditor.org/u/snaidamast)\
**Post date:** [September 29, 2023, 4:24pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/10 "2023-09-29T16:24:42Z")

</div>

If you are reading the TMX file programatically, the “data” node should have all of the “global” tile-ids that you have placed on your visual map. BY subtracting “1” from each number you will then get the “local” id that is stored in the TSX file. You can relate these two as a result and get the actual name of the tile for any x,y position.

I have the code for this if you would like me to post it for you. It uses the Open Source utility, “TiledCS” to get the primary attributes of each file so that you can get to the actual data you require to handle…

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [September 29, 2023, 4:36pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/11 "2023-09-29T16:36:09Z")

</div>

> [@snaidamast](#):
>
> BY subtracting “1” from each number you will then get the “local” id that is stored in the TSX file.

Note that this is only accurate if your maps can only ever have at most one tileset. The more robust approach is to subtract the tileset’s firstgid from the tile to get its local tile ID. The GIDs and firstgids are what allow you to distinguish between tiles from different tilesets in a single map. More info in the docs: [Global Tile IDs — Tiled 1.10.2 documentation](https://doc.mapeditor.org/en/stable/reference/global-tile-ids/#mapping-a-gid-to-a-local-tile-id)

---

<div class="post-metadata">

**Author:** ![snaidamast](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/snaidamast/32/3841_2.png) [@snaidamast](https://discourse.mapeditor.org/u/snaidamast)\
**Post date:** [September 29, 2023, 4:37pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/12 "2023-09-29T16:37:59Z")

</div>

Thank you, Eishiya, for elaborating on this.

Since I am only using a single tileset, I did not consider this issue.

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [September 29, 2023, 4:43pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/13 "2023-09-29T16:43:48Z")

</div>

Technically, there’s no guarantee in the TMX format that even with a single tileset the firstgid will be 1. Tiled always writes them that way, but the format allows for any firstgid. Of course, this is a rather unlikely scenario that would require the user to use a program other than Tiled to edit the map, so it’s probably not too weird to disregard it.

…why is this conversation happening in this thread, though? Nothing in the OP’s questions has to do with parsing layer data.

---

<div class="post-metadata">

**Author:** ![snaidamast](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/snaidamast/32/3841_2.png) [@snaidamast](https://discourse.mapeditor.org/u/snaidamast)\
**Post date:** [September 29, 2023, 4:51pm UTC](https://discourse.mapeditor.org/t/possible-to-uniquely-identify-tiles-and-possible-to-move-already-placed-tiles-in-batch/6285/14 "2023-09-29T16:51:57Z")

</div>

From the initial comment, the author was referring to understanding the tile ids through programming…
