Loading Tiled maps

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Eventide
Prole
Posts: 3
Joined: Thu Jul 30, 2015 4:14 am

Loading Tiled maps

Post by Eventide »

So, I'm using this to load Tiled maps: https://love2d.org/wiki/TiledMapLoader

But the result is always messy... Is that code incompatible with the actual version of Tiled?

This is what i see on Tiled:
Image

This is what i see in-game:
Image

The only thing i modified on the code was adding a mapPixel function to interpret the blue from the sprites as transparency, this was working pretty well on another map, but on that one it's also messy, i don't know why...

Here is my slightly modified tmx loader: http://pastebin.com/fcAWFNTa

Thanks in advance.
Last edited by Eventide on Thu Jul 30, 2015 8:12 am, edited 1 time in total.
Eventide
Prole
Posts: 3
Joined: Thu Jul 30, 2015 4:14 am

Re: Loading Tiled maps

Post by Eventide »

Meanwhile the thread wasn't approved i found a better library: https://github.com/karai17/Simple-Tiled-Implementation

But it doesn't even load, it outputs the error attempt to concatenate field "image"(a nil value) on map.lua:112.

I've received a similar error with the library said on my first post and I've fixed it by adding "/data/" to every asset loaded, I didn't figured out how to do this with STI, but I've tried to change my map file directly, and it didn't worked, the "/data/" on the output string was duplicated.

EDIT:
Error output:
Image

My main.lua file: http://pastebin.com/PjB86a2q
My map file: https://gist.github.com/anonymous/04f10315b3fd143d080a

Maps are stored on data\maps
Spritesheets are stored on data\graphics\map
STI is stored on libs\sti
Eventide
Prole
Posts: 3
Joined: Thu Jul 30, 2015 4:14 am

Re: Loading Tiled maps

Post by Eventide »

Problem is solved.
User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: Loading Tiled maps

Post by Ulydev »

Maybe you could post the fix here for people who have the same issue. ;)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests