Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Tiled and Pony-Tiled problem
Started by Abdo23 Dec 07 2018 07:40 PM

10 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Abdo23

[GLOBAL: userInfoPane.html]
Abdo23
  • Contributor

  • 113 posts
  • Corona SDK

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.


[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 368 posts
  • Corona SDK

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.



[TOPIC: post.html]
#3

Abdo23

[GLOBAL: userInfoPane.html]
Abdo23
  • Contributor

  • 113 posts
  • Corona SDK

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/

 

 

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.


[TOPIC: post.html]
#4

Abdo23

[GLOBAL: userInfoPane.html]
Abdo23
  • Contributor

  • 113 posts
  • Corona SDK

Help, please. I'm stuck.



[TOPIC: post.html]
#5

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 368 posts
  • Corona SDK

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.



[TOPIC: post.html]
#6

Abdo23

[GLOBAL: userInfoPane.html]
Abdo23
  • Contributor

  • 113 posts
  • Corona SDK

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. 



[TOPIC: post.html]
#7

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 368 posts
  • Corona SDK

You're "welcome". :D

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.



[TOPIC: post.html]
#8

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,000 posts
  • Corona SDK

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



[TOPIC: post.html]
#9

Abdo23

[GLOBAL: userInfoPane.html]
Abdo23
  • Contributor

  • 113 posts
  • Corona SDK

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.



[TOPIC: post.html]
#10

Abdo23

[GLOBAL: userInfoPane.html]
Abdo23
  • Contributor

  • 113 posts
  • Corona SDK

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.



[TOPIC: post.html]
#11

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 368 posts
  • Corona SDK

Glad to hear you found a fix.


  • Abdo23 likes this


[topic_controls]
[/topic_controls]