-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading map with TSX tileset error "Missing attribute: tilecount" #265
Comments
Will take a look into it today. |
Tried to upload the files to in case it helps but GitHub does not seem to like TSX or TMX files. Sharing via gist and adding the PNG here which GitHub seems happy with. It is a simple map that I created just to test a TMX with TSX tileset. |
Hmm, I can't seem to reproduce the bug. Can you send the code you're using to load it, and the version of the crate you are using? |
The code I'm using is linked below. The version being used is 0.11.0. The repo below is a fork of bevy_ecs_tilemap which I updated to 0.11.0. It was on 0.10.2 before but TSX maps did not work then either, thought I would update to 0.11.0 first. Bevy has an AssetLoader, to load TMX maps via it the AssetLoader trait needs to be implemented. This trait provides a bytes to the file which I have added to BytesResourceReader which is implemented in the file below just above the lines linked. The code linked works with regular maps, just not TSX maps. |
I've pushed a demo of this error to the above repo on this branch. https://github.com/Bushstar/bevy_ecs_tilemap/tree/map_loading_error You can run it with...
|
One of the goals for 0.11 was for the crate to work with bevy's loading system - However, due to lack of time on my side, I had to upload it as-is. I'm pretty sure the crate cannot work with bevy because our crate expects dependencies to be loaded secuentially without stopping, however, bevy loads files one by one. You'll have to go the embedded way, or try to add support for it on the crate (which would be really appreciated!) |
Thanks for the explanation, that makes sense. Based on this I'll take a look at updating bevy_ecs_tilemap to work with TSX maps and will create a PR if successful. |
Managed to get TSX maps working with the commit below. Not so happy about manually specifying the |
Neat! Ideally we should probably have support for loading dependencies separately from their parents, but that would work for now. It ain't perfect since Bevy has no idea about the deps and it won't work with other filesystems that aren't the system one, but it'll do until we update the crate to support this usecase. Thanks! |
I've got it, went back and checked LoadContext, it has a method to get the AssetIo so we do not need to hard code the assets directory and use the path set from Bevy. |
Perfect. I'll close this issue for now then. Thank you very much for opening it and bringing it to my attention :) |
Not sure if this is a bug or user error. I created a map with a compiled version of Tiled using the latest source as of the time of this issue, the map uses a TSX tilemap. When trying to load that map via
load_tmx_map
I get the following error.Missing attribute: tilecount
The tileset attribute looks like the following. Note that the TMX, TSX and PNG are all in the same folder.
<tileset firstgid="1" source="simple-isometric.tsx"/>
The tilecount attr
tsx_map.tar.gz
ibute is in the
simple-isometric.tsx
.<tileset version="1.10" tiledversion="1.10.1" name="simple-isometric" tilewidth="64" tileheight="64" tilecount="54" columns="6">
If I load a map with an embedded tileset then it loads without error.
The text was updated successfully, but these errors were encountered: