SSBMTonberry / tileson

A modern and helpful cross-platform json-parser for C++, used for parsing Tiled maps.
BSD 2-Clause "Simplified" License
193 stars 30 forks source link

Can't retrieve tile data from a layer in a Tile Group Layer #101

Open volke0 opened 1 year ago

volke0 commented 1 year ago

I've tried to pull tile data from a layer in a Tile Group Layer and it says I have no tile data, but when in fact I do. It just seems that the program doesn't generate tile data from layers in the Tile Group Layer?

SSBMTonberry commented 1 year ago

Hello, @volke0 , and thank you for your issue :slightly_smiling_face: I'll gladly help you, but to be able to help you I would need some kind of map that reproduces the problem, and some code showcasing how you are trying to retrieve the data you want. If this is caused by a bug in Tileson, I'll figure it out pretty soon if you provide me something I can create a test with. Either way I'm sure we'll find a solution to your problem :slightly_smiling_face:

What you are talking about should work, but there could be something about the Tile Group Layer I've been missing out.

volke0 commented 1 year ago

Hi! Thank you for responding! I actually figured out how to generate tile data for the layer in the Tile Group Layer. It just seems that Tileson just doesn't generate it automatically. Here is how I solved my problem (circled in red). image

All I'm doing with this code is just drawing each layer that is a Tile Layer and only drawing my tile change in the Tile Group Layer when tile changes are activated.

And here is the map .json file that I was using to begin with. death_cave_start.zip

SSBMTonberry commented 1 year ago

I take it this is no hurry, since you've found a solution to your problem. I implemented automatic tile generation for tiles missing properties for the TileLayer many years ago, since Tiled does not include tile information for tiles without properties. As I see it: The same thing should also happen for tile groups, so if it doesn't, it's definitely a bug / missing feature :slightly_smiling_face:

I'll keep this issue open, and assign it to the next roadmap for v1.5.0. Thanks for reporting, and thanks for attaching a demo to reproduce the error!

volke0 commented 12 months ago

Sorry for the late reply... But you are absolutely welcome!