# Change JSON export mode

**URL:** <https://discourse.mapeditor.org/t/change-json-export-mode/3244>\
**Category:** Questions\
**Created:** [June 5, 2018, 8:10am UTC](https://discourse.mapeditor.org/t/change-json-export-mode/3244 "2018-06-05T08:10:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Mnk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/the_mnk/32/2274_2.png) [@The\_Mnk](https://discourse.mapeditor.org/u/The_Mnk)\
**Post date:** [June 5, 2018, 8:10am UTC](https://discourse.mapeditor.org/t/change-json-export-mode/3244/1 "2018-06-05T08:10:00Z")

</div>

Hello, I would like to modify the way in which JSON data is exported

I just want the empty tile to be -1 and each tile number to match its JSON data.

tile number 0 in JSON will also be number 0.  
Currently it is number 1 and the same happens with all the others.

I want to change this, how can I do it?

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [June 5, 2018, 10:36am UTC](https://discourse.mapeditor.org/t/change-json-export-mode/3244/2 "2018-06-05T10:36:28Z")

</div>

> [@The\_Mnk](#):
>
> I want to change this, how can I do it?

You can change that by modifying the code in `gidmapper.cpp` and compiling Tiled. This will also affect the TMX files, which work with the same kind of global tile IDs. It could also affect code using the `GidMapper` since it assumes global tile IDs are `unsigned`, which can’t represent -1. And it would mess with the flags used to store tile flipping. Finally, you’d of course end up with a Tiled that is incompatible with everybody else’s version of Tiled, unless you implemented this as an option.

Probably subtracting 1 in your own code would be a whole lot easier?

---

<div class="post-metadata">

**Author:** ![The\_Mnk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/the_mnk/32/2274_2.png) [@The\_Mnk](https://discourse.mapeditor.org/u/The_Mnk)\
**Post date:** [June 6, 2018, 12:38pm UTC](https://discourse.mapeditor.org/t/change-json-export-mode/3244/3 "2018-06-06T12:38:34Z")

</div>

Hi, thanks, I found a solution.  
I could not subtract 1 because I use an engine and I’m not sure I can access that code.
