Growler Posted May 15, 2018 Share Posted May 15, 2018 @obiot @Parasyte When I created my own TMX maps, somehow they'd auto generate the tileset data within the TMX map: <?xml version="1.0" encoding="UTF-8"?> <map version="1.0" tiledversion="1.1.3" orientation="orthogonal" renderorder="left-down" width="40" height="20" tilewidth="16" tileheight="16" infinite="0" backgroundcolor="#dbfbf4" nextobjectid="8"> <tileset firstgid="1" name="sample_tiles" tilewidth="16" tileheight="16" tilecount="100" columns="10"> <image source="../img/map/sample_tiles.png" width="160" height="160"/> </tileset> <layer name="Ground" width="40" height="20"> <data encoding="base64"> I have a mapper working on the map, and they're using a newer Tiled. It seems to generate references to external .tsx files to get the tileset images: <?xml version="1.0" encoding="UTF-8"?> <map version="1.0" tiledversion="2017.10.11" orientation="orthogonal" renderorder="right-down" width="110" height="116" tilewidth="32" tileheight="32" infinite="0" nextobjectid="3"> <tileset firstgid="1" source="g.tsx"/> <tileset firstgid="343" source="untitled.tsx"/> <tileset firstgid="2940" source="s.tsx"/> <layer name="water" width="110" height="116"> <data encoding="csv"> Here's an example reference of g.tsx file: <tileset firstgid="1" source="g.tsx"/> <?xml version="1.0" encoding="UTF-8"?> <tileset name="ground" tilewidth="32" tileheight="32" tilecount="342" columns="19"> <image source="spain_ground_tiles3.png" width="608" height="576"/> </tileset> From the docs, http://docs.mapeditor.org/en/stable/reference/tmx-map-format/ , this seems fine: "source: If this tileset is stored in an external TSX (Tile Set XML) file, this attribute refers to that file. That TSX file has the same structure as the <tileset> element described here. (There is the firstgid attribute missing and this source attribute is also not there. These two attributes are kept in the TMX map, since they are map specific.)" I'm able to open the map in Tiled no problem, but Melon gives me error "melonJS: 'spain_ground_tiles3.png' file for tileset 'ground' not found!" Why is this? Please see attached image: Quote Link to comment Share on other sites More sharing options...
obiot Posted May 15, 2018 Share Posted May 15, 2018 Hi, Stupid question, did you add the png to the list of assets to be loaded ? Quote Link to comment Share on other sites More sharing options...
Growler Posted May 15, 2018 Author Share Posted May 15, 2018 @obiot I realized they weren't added. I ran Grunt which usually grabs all the assets but this time it didn't grab the PNGs. Weird. obiot 1 Quote Link to comment Share on other sites More sharing options...
obiot Posted May 16, 2018 Share Posted May 16, 2018 indeed, the grunt task will only take assets for a certain type from only the corresponding directory : https://github.com/melonjs/boilerplate/blob/master/Gruntfile.js#L136 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.