Map JSON format has changed in Tiled in versions higher than 1.1.6. Cause of that provided tmx map in phaserquest won't be exported to JSON format supported by format script.
Issue
format script throws an error when formatting JSON map exported from Tiled in versions higher than 1.1.6:
➜ server git:(master) node -e 'require("./format").format()'
Formatting ...
/Users/adamsawicki/Kodowanie/phaserquest/js/server/format.js:62
var tileProperties = map.tilesets[0].tileproperties[layer.data[j]-1];
^
TypeError: Cannot read property '-1' of undefined
at /Users/adamsawicki/Kodowanie/phaserquest/js/server/format.js:62:72
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
This, in turn, makes running edited map impossible.
Possible solution
Provide information to developers that using Tiled version 1.1.6 or lower is a workaround for the issue.
Context
Map JSON format has changed in Tiled in versions higher than 1.1.6. Cause of that provided
tmx
map inphaserquest
won't be exported to JSON format supported byformat
script.Issue
format
script throws an error when formatting JSON map exported from Tiled in versions higher than 1.1.6:This, in turn, makes running edited map impossible.
Possible solution
Provide information to developers that using Tiled version 1.1.6 or lower is a workaround for the issue.
Alternative solution
Modify
format
script to the new JSON format.Additional information
More details can be found in this thread: https://discourse.mapeditor.org/t/are-old-versions-of-tiled-available/3721/4