Page 1 of 1

Issue with loading Tiled-maps with ATL and STI *file added*

Posted: Sat Sep 19, 2015 5:18 pm
by andreasw
Hi,

I'm new to both Löve and Tiled. I'm trying to make a simple platformer and was following this tutorial. Even though it's old it's the best I could find.

Everything was working out nicely until I tried loading a map from the Tiled editor. I can load the map graphically but when I add the findSolidTiles(map) function (code) I get the following error message:
Error

main.lua:54: attempt to index field 'tl' (a nil value)


Traceback

main.lua:54: in function 'findSolidTiles
main.lua:19: in function 'load'
[C]: in function 'xpcall'
Seems like the map is loaded but not the list of layers from the map. I saw that several people were complaining about the same issue in the comments but that they could solve it by changing the name of the layer. I tried renaming the layer and restarting Tiled and making completely new maps in different formats but nothing worked. I looked at the documentation for ATL and tried changing the way the layers were loaded but only got different but similar errors.

Then I tried downloading the tutorial project but got another similar error when trying to run it.

I then tried using STI instead since I found out that ATL development was discontinued a couple of years ago, but when using a very simple example that I found somewhere in the documentation I get the following error message:
Error

sti/map.lua:204: attempt to compare number with nil


Traceback

sti/map.lua:204 in function 'setTileData'
sti/map.lua:170: in function 'setLayer'
sti/map.lua:56: in function 'init'
sti/init.lua:38: in function 'new'
main.lua:4: in function 'load'
[C]: in function 'xpcall'

So my guess now is that I'm doing something wrong in Tiled. But I have tried everything I can come up with in it and it shouldn't be anything with the format since ATL uses .tmx and STI uses .lua-files? My other guess is that I don't initiate the map correctly but since I got it to render graphically and since I get a similar error with simpler code and STI I'm leaning more towards the problem being something related to Tiled.

Does anyone recognize this problem or know what I'm doing wrong? Thanks in advance.

Re: Issue with loading Tiled-maps with ATL and STI *file add

Posted: Mon Sep 21, 2015 5:03 am
by Karai17
ATL is discontinued and does not work in LOVE 0.9+. You essentially have to use STI. Can you post your love with STI?

Re: Issue with loading Tiled-maps with ATL and STI *file add

Posted: Mon Sep 21, 2015 11:59 am
by andreasw
Karai17 wrote:ATL is discontinued and does not work in LOVE 0.9+. You essentially have to use STI. Can you post your love with STI?
Yeah I saw that it was discontinued but only thought there were some bugs? Anyhow that's why I tried STI. Attaching love!

Re: Issue with loading Tiled-maps with ATL and STI *file add

Posted: Mon Sep 21, 2015 7:04 pm
by Karai17
Your map is compressed. You need to set the map to CSV-style, not gzip.

Re: Issue with loading Tiled-maps with ATL and STI *file add

Posted: Mon Sep 21, 2015 9:15 pm
by andreasw
Karai17 wrote:Your map is compressed. You need to set the map to CSV-style, not gzip.
Thanks! That was the issue with STI. I tried all formats with ATL before trying STI and also read in the documentation that it supported "zlib/gzip compression". Didn't think to try other formats with STI since the problem seemed so similar.

STI it is then!