Scripting API: Missing tileset "firstGID" property, and flip flag values don't match
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 12.9k
- Forks
- 2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 8
Description
I'm trying to sort out the conversion to and from tile IDs and GIDs, but the scripting API seems designed to prevent that.
__First GID__
Documentation, issues, and forum posts all mention how to use the tileset's "first GID". It's easy, it makes sense, you just add and subtract. However, in the scripting API, tilesets are missing the firstGID property, instead they have "nextTileID" - the tile index after the last one used—in other words, the _next_ tileset's firstGID...???
__Flag Bits__
It's the same with the flag bits, all the information you can find says that the flags for flipped/rotated tiles use the _highest_ four bits (for obvious reasons, so they don't intersect with local tile ID numbers), but the [flag variables](https://www.mapeditor.org/docs/scripting/classes/tile.html#flippedantidiagonally) that are part of the scripting API use the _lowest_ four bits.
I'm sure there must be reasons for this, but for me it's just adding hours of frustration for no reason. The scripting API seems to provide the _exact opposite_ of what I want (and what the docs say you need). Possibly the solution is just to improve the documentation. Quite a lot of information that you need to import and export to and from Tiled (and for scripting in general) is missing or just very hard to find.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the scripting API documentation for tilesets and tiles, especially nextTileID and the linked flippedAntidiagonally flag variables. Compare those descriptions with the documented first GID and highest-bit flip flags, then clarify the intended conversion and representation so the API and documentation agree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation, tooling
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100