SSBMTonberry / tileson

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

Issues opening maps #99

Closed sakesfar closed 1 year ago

sakesfar commented 1 year ago

@SSBMTonberry Thank you for such a fast reply! As a continuation of the issue discussed at https://github.com/SSBMTonberry/tileson/issues/97#issuecomment-1705301415

Saving your map to a json format in Tiled should be straight-forward, and is done within Tiled itself. The extension does not matter, as long as the contents of the file is json. I THINK .tmj contains .json-data, but it's quite a while since I've created a new map, so I can't say 100% sure. You'll find out if you open the .tmj file and check its contents, though :)

Yes, it does save so and contains JSON data. Yet still, when typing trying to open it in.tmjextension it does not work. Now, I get this

expected value, got '<' (60)
3

I have attached testlvl.txt , it is basically all the content of its .tmj version int txt file. I have also attached, testlvl2.txt , txt version of `testlvl2.json

Thank you a lot for your work!

testlvl2.txt

testlvl.txt

SSBMTonberry commented 1 year ago

@sakesfar: testlvl.txt contains xml, and is incompatible. testlvl2.txt is a json, but it contains an external tileset of type .tsx, which is xml. Tileson is only able to parse json, so your external tileset must also be of type json, which should be okay to fix by just specifying that in Tiled. Alternatively you can choose to "embed tilsets", then export your map to a json type, to make sure everything is included in the map, which makes sure you don't need anything external. Hope this helps. If you have any further questions or issues, just post it in here, and I'll try to help you further 🙂

Thank you for using Tileson 😄

SSBMTonberry commented 1 year ago

Also, there are other people that have met this issue before. You can see the discussions in #42 and #49 But yeah, the issues there are probably exactly the same thing you are struggling with 🙂

sakesfar commented 1 year ago

@SSBMTonberry Ohhh, I asked exactly the same questions!!!! Please, excuse my lack of attention 🤦 that caused this bothering!

I did what you said and it worked! Great Tilseonyou created!!! Endless thanks!

SSBMTonberry commented 1 year ago

Good to hear that you got the issue solved :slightly_smiling_face: Happy to help :smile: