Advanced Tiled Loader - No longer maintained

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Re: Advanced Tiled Loader - Updated to 0.11.2!

Post by adrix89 »

Kadoba wrote:
adrix89 wrote:Quick question on license.

The project is CC-BY-SA so does that mean it is contagious to my project?
If I make a game but not modify the library does that mean I have to license my game SA?
What is the authors interpretation of the license on this?
The license is MIT and you definitely don't have to license your game the same way. Lua uses MIT as well so if licenses worked that way it wouldn't matter if you included ATL or not. :P

Honestly, your only obligation is to not remove the license from the library.
Also don't sue me
Damn got mixed the posts,I was referring to another project. Sorry.
I use Workflowy but you can check out Dynalist as its the better offer.
User avatar
Karai17
Party member
Posts: 909
Joined: Sun Sep 02, 2012 10:46 pm

Re: Advanced Tiled Loader - Updated to 0.11.2!

Post by Karai17 »

So I think I still don't understand how Map:autoDrawRange() works :( I have a sort of large map in my project now and it is causing significant fps loss so I figure i should actually start using it. :P

My interpretation of this is:

Code: Select all

Map:autoDrawRange(tx, ty, scale, pad)
tx: x position of first pixel to draw
ty: y position of first pixel to draw
scale: self evident
pad: ???????????????????????????????????????????????????????????????????????????
When ever I try to turn this on, my entities always seem to disappear unless I am standing within the top left of the map. What am I doing wrong :(
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader - Updated to 0.11.2!

Post by Kadoba »

The tx and ty parameters are the values that you feed love.graphics.translation so they should be negative of the screen's position. Padding is just extra room to draw around the viewing area, just in case.
User avatar
Karai17
Party member
Posts: 909
Joined: Sun Sep 02, 2012 10:46 pm

Re: Advanced Tiled Loader - Updated to 0.11.2!

Post by Karai17 »

Right, so tx and ty are the translation, which I get. scale and padding also make sense (though I would use the word margin, not padding)

So I'm not too crazy, I do understand the values going in... yet I do not understand why my Entities disappear unless I am on the top left of the map...

If you'd be willing to have a gander, I'd appreciate it c:

http://dl.dropbox.com/u/12958391/KLDerp.zip.love

The relevant file is screens/gameplay.lua. The line should be commented out in update. I'd update the file but I am not currently at home. :x
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader - Updated to 0.11.2!

Post by Kadoba »

Ah You're using ObjectLayers. Objects/ObjectLayers are really only meant to read data from. ATL objects keep a seperate table that stores their drawing information. This doesn't update by itself so you have to call Object:updateDrawInfo() every time the object moves. Having said that, you should try and use custom layers instead. Read the information you need from object layers and create your custom objects inside custom layers. That's pretty much what you're doing anyway except you're building off of the ATL objects.

I just finished a tutorial on how to do this.
https://github.com/Kadoba/Advanced-Tile ... Tutorial-3
User avatar
Karai17
Party member
Posts: 909
Joined: Sun Sep 02, 2012 10:46 pm

Re: Advanced Tiled Loader - Updated to 0.11.2!

Post by Karai17 »

Ooh, brilliant, I'll have a look!

Note: I just updated ATL and I got this error:

Error: Syntax error: libs/AdvTiledLoader/Object.lua:57: unexpected symbol near '1'

Removing the '1' fixed it :P
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader - Updated to 0.11.2!

Post by Kadoba »

I have no idea how that got there but it's fixed on the repo now.
User avatar
Karai17
Party member
Posts: 909
Joined: Sun Sep 02, 2012 10:46 pm

Re: Advanced Tiled Loader - Updated to 0.11.2!

Post by Karai17 »

:*

So I'm looking through your tutorial and I got it working fine (hurrah!) but now that I am trying to integrate this into my game, I am a little baffled on how layer:toCustomLayer() works. It calls convertPlayer, I get that much. What confuses me is where exactly playerOld comes from. It seems to just sort of "know" which scares me a little :P

I want to make this work with my generic Entity class so that I can more easily manage different types of objects. Do I need to place a bunch of objects in my map and then convert them, or can I create them from code? If that is possible, it may be easier for many entities with non-fixed spawn points...
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader - Updated to 0.11.2!

Post by Kadoba »

The conversion function is called on every object and the value that is returned from the function takes the place of the old object. In the tutorial there is only the player object so that's how the function just "knows".

This would probably be a more flexible demonstration of it's use:

Code: Select all

-- assume there is a table called "objects" that indexes all object classes by their name

function convert(obj)
   return objects[obj.name]:new(obj.x, obj.y, obj.properties.imagePath) --etc
end

map("some layer"):toCustomLayer(convert)
If you omit the function then the old objects would then be contained in CustomLayer.objects. You could just as well iterate over all of them yourself.
User avatar
Karai17
Party member
Posts: 909
Joined: Sun Sep 02, 2012 10:46 pm

Re: Advanced Tiled Loader - Updated to 0.11.2!

Post by Karai17 »

I just updated ATL from GitHub and when I disable autoDrawRange(), only tiles from 0,0 to 27,21 draw, regardless of where I move to. I'm still trying to wrap my head around custom layers so I wanted to disable this for now but... :\

I've tried multiple maps, too. Thoughts?
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests