Not sure if this is the best place to ask about tiled, but I know it does have very quick responses so off I go. I am using tiled to generate a tile map for the Ludum Dare, but whenever I export it, it always leaves all of the values 1 too high. What is the quickest way to move all of theses values one down?
Asked
Active
Viewed 41 times
0
-
Perhaps you are updating the index one time too much... Perhaps some more information on your data structure would be very useful... – darmat Aug 24 '13 at 04:01
-
@Jqmfg: Indeed, please provide more information... – László Papp Aug 24 '13 at 04:40
-
Is this a programming question? (Also, you forgot to mention *what* values are off by one!) In any case, does [this help](http://developer.wz2100.net/wiki/MappingTips#Off-by-onetipsandtricks)? – Cameron Aug 24 '13 at 04:47
1 Answers
0
You are referring to the tile numbers of that appear in an array of tiles in .TMX files produced with the Tiled program. There is a simple reason for this: typically, arrays are stored with [0] being the first index; Tiled stores those tiles beginning with [1]. This means that when you are integrating these files into whatever game engine you are using, you will need to keep this in mind. Whether it's iterating beginning at 1 or simply subtracting 1 from every tile value you retrieve, it's easiest to just use TMX files with this in mind rather than trying to rewrite the TMX files themselves.

benny.bennett
- 700
- 1
- 8
- 25