I am trying to build 2D maps with Tiled Map Editor for my game, and I export them under text format, so a tile can look like this:
1,2,3,15,2,12,2
5,23,1,6,2,3,4,6
and so on, for many rows. In this link you can see an example of a map, to get a better idea.
Now let's say I have 3 layers, each using its own tileset. The numbers in the layer represent the ID of the tile, basically the number of the tile in the sheet. If grass is the 2nd tile, then the ID is 2, and so forth.
However, as you can see in the link, different tilesets will export different IDs per layer, notice how in the object layer I can have IDs such as 81, when in fact the ID is only 1, so it adds up 80 or so.
Since I am trying to make my map system as flexible as possible, I need the real ID in order to make some calculations. How does tiled export these sort of IDs? I simply want to determine what number to substract in order to get the id, like so:
tile.id = currentid - something_strange;