# How to customize exporting to binary files？

**URL:** <https://discourse.mapeditor.org/t/how-to-customize-exporting-to-binary-files/6705>\
**Category:** Questions\
**Created:** [April 25, 2024, 8:12am UTC](https://discourse.mapeditor.org/t/how-to-customize-exporting-to-binary-files/6705 "2024-04-25T08:12:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![liuruifeng1993](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/liuruifeng1993/32/4521_2.png) [@liuruifeng1993](https://discourse.mapeditor.org/u/liuruifeng1993)\
**Post date:** [April 25, 2024, 8:12am UTC](https://discourse.mapeditor.org/t/how-to-customize-exporting-to-binary-files/6705/1 "2024-04-25T08:12:13Z")

</div>

For example, when using TMX for client development, the server only needs to obtain map terrain data, that is, output a length, width, and whether the points are walkable, and output them to a binary file. How to customize an export option?I am a newcomer, and I saw a similar question mentioned by someone before saying that Python can be used for implementation? Can you provide more detailed steps? What is the JavaScript script written below this address for?

---

<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:** [April 25, 2024, 8:16am UTC](https://discourse.mapeditor.org/t/how-to-customize-exporting-to-binary-files/6705/2 "2024-04-25T08:16:25Z")

</div>

You can extend Tiled with JavaScript, including the ability to add custom export formats. This is documented here:

- [Scripting — Tiled 1.10.2 documentation](https://doc.mapeditor.org/en/stable/reference/scripting/)
- Use [`tiled.registerMapFormat`](https://www.mapeditor.org/docs/scripting/modules/tiled.html#registerMapFormat) to register custom map formats.
- See also [`BinaryFile`](https://www.mapeditor.org/docs/scripting/classes/BinaryFile.html) for writing binary files (the content of which is constructed with standard JS [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) API.
