Tiled and Pony-Tiled problem

I’ve successfully imported my Tiled map into Corona using the “PonyTiled” library. The problem is that the assets are taking each other positions, and some don’t appear at all. I checked the naming inside Tiled and for the files themselves and everything is correct. What might be the problem?

Edit : I’m getting this error even though, the “Tile Layer Format” is set to “CSV” in Tiled.

ERROR: Tile layer encoding/compression not supported. Choose CSV or XML in map options.

Do you have the newest version of PonyTiled? There was a recent post about it and it sounds like the issues that it fixed might relate to your issue. See https://forums.coronalabs.com/topic/74366-ponytiled-now-updated-for-tiled-121/

If that doesn’t help, then with issues like these, where everything is supposedly correct but something still isn’t working, it often helps to upload a small sample project that demonstrates the issue and provide a clearer explanation of what you’ve done, what you believe should have happened, what happened instead, etc. That way, it’ll be easier for others to try and help you out.

Yes, I’m using the latest version. I only downloaded it yesterday. I’m also using a Lua export not json. 

Edit: I’m getting this error even though, the “Tile Layer Format” is set to “CSV” in Tiled.

ERROR: Tile layer encoding/compression not supported. Choose CSV or XML in map options.

Help, please. I’m stuck.

As I mentioned before, uploading a sample project that demonstrates the problem will make it easy for others to help you. Also, if you provide new information, it’s best to create a new post as edits won’t send notifications of new messages.

Based on that error, you seem to be using some compression or encoding in your files, which are not supported by PonyTiled. With the information you’ve provided, I personally can’t help you any further.

Uploading a sample project would be helpful if there was a problem with my code that I actually wrote. But, in this case, the problem is not my code it’s with the PonyTiled library. My project only contains two lines of code just to initialize PonyTiled and to direct it to where the files it needs are. Uploading a sample project would be redundant and provides no benefit at all. I provided an error and described how the error doesn’t make sense as I’m using the right option inside Tiled. Have you yourself tried working with PonyTiled recently?!
Anyway, thanks for trying to help. 

You’re “welcome”. :smiley:

The reason why I had asked for the sample project was because this is the classic issue of having error proof code but how there still is an error. I have indeed used the newest version of PonyTiled and I haven’t run into issues.

Just download the project from https://github.com/ponywolf/ponytiled and compare it to yours. For starters, the project’s maps use json files.

While you may not see the value in posting your project, it’s still something really helpful.

Tiled is outputing something that you’re using. You may have written two lines of code, but there are hundreds of lines of code output by Tiled.

People willing to help you could look at how you’re using Tiled and offer valuable advice. 

Rob

I actually found the problem but I don’t know how to fix it. 

The problem is that Tiled exports the file with wrong tile IDs.  In Tiled, I use 3 tiles and their IDs are (0-1-2) but in the exported file it shifts the numbers by one, so they become (1-2-3) So the tile with ID=0 never shows and the others appear in the wrong place.

I created different maps and tilesets and always the same result.

Ok found a workaround.

I changed the IDs manually for each tile in the exported file. Not in the data table but in each individual tile table.

Glad to hear you found a fix.

FYI, lua export from Tiled to ponyTiled is a little wonky at best. I don’t use lua export (or external tilesets), so those features don’t get much testing.

Do you have the newest version of PonyTiled? There was a recent post about it and it sounds like the issues that it fixed might relate to your issue. See https://forums.coronalabs.com/topic/74366-ponytiled-now-updated-for-tiled-121/

If that doesn’t help, then with issues like these, where everything is supposedly correct but something still isn’t working, it often helps to upload a small sample project that demonstrates the issue and provide a clearer explanation of what you’ve done, what you believe should have happened, what happened instead, etc. That way, it’ll be easier for others to try and help you out.

Yes, I’m using the latest version. I only downloaded it yesterday. I’m also using a Lua export not json. 

Edit: I’m getting this error even though, the “Tile Layer Format” is set to “CSV” in Tiled.

ERROR: Tile layer encoding/compression not supported. Choose CSV or XML in map options.

Help, please. I’m stuck.

As I mentioned before, uploading a sample project that demonstrates the problem will make it easy for others to help you. Also, if you provide new information, it’s best to create a new post as edits won’t send notifications of new messages.

Based on that error, you seem to be using some compression or encoding in your files, which are not supported by PonyTiled. With the information you’ve provided, I personally can’t help you any further.

Uploading a sample project would be helpful if there was a problem with my code that I actually wrote. But, in this case, the problem is not my code it’s with the PonyTiled library. My project only contains two lines of code just to initialize PonyTiled and to direct it to where the files it needs are. Uploading a sample project would be redundant and provides no benefit at all. I provided an error and described how the error doesn’t make sense as I’m using the right option inside Tiled. Have you yourself tried working with PonyTiled recently?!
Anyway, thanks for trying to help. 

You’re “welcome”. :smiley:

The reason why I had asked for the sample project was because this is the classic issue of having error proof code but how there still is an error. I have indeed used the newest version of PonyTiled and I haven’t run into issues.

Just download the project from https://github.com/ponywolf/ponytiled and compare it to yours. For starters, the project’s maps use json files.

While you may not see the value in posting your project, it’s still something really helpful.

Tiled is outputing something that you’re using. You may have written two lines of code, but there are hundreds of lines of code output by Tiled.

People willing to help you could look at how you’re using Tiled and offer valuable advice. 

Rob

I actually found the problem but I don’t know how to fix it. 

The problem is that Tiled exports the file with wrong tile IDs.  In Tiled, I use 3 tiles and their IDs are (0-1-2) but in the exported file it shifts the numbers by one, so they become (1-2-3) So the tile with ID=0 never shows and the others appear in the wrong place.

I created different maps and tilesets and always the same result.