Advanced Tiled Loader - No longer maintained

Showcase your libraries, tools and other projects that help your fellow love users.
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 »

If you want to draw everything regardless of where the camera is you can set map.viewW and map.viewH to math.huge.
Xikeon
Prole
Posts: 1
Joined: Mon Oct 15, 2012 5:16 pm

Re: Advanced Tiled Loader - Updated to 0.11.2!

Post by Xikeon »

Hi,

First of thanks for this. Looks great and I would like to use it. I'm having an issue though.

When I launch the app, it shows the map and then directly starts fading out and I only see this:
Image

This is my code:

Code: Select all

-- Isometric Test

function love.load()
	loader = require "AdvTiledLoader.loader"
	loader.path = "maps/"
	map = loader.load("desert.tmx")
end

function love.keypressed(k)
	if k == 'escape' then
		(love.event.push or love.event.quit)('quit')
	end
end

function love.draw()
	map:draw()
	love.graphics.print("Hello World", 100, 100)
end
Does anyone maybe know why this happens?

edit: This seemed to be an issue with getColor() and being handled in IRC. Not an issue in ATL specifically apparently.
User avatar
Uhfgood
Prole
Posts: 35
Joined: Sat Jul 28, 2012 10:04 pm
Location: Oregon, US
Contact:

Re: Advanced Tiled Loader - Updated to 0.11.2!

Post by Uhfgood »

Still asking for a way to skin maps. I also had a thought about it, what if you saved multiple tilesets in your tiled map, and then the ATL would simply allow you to assign different tilesets to each layer. I don't think it would be hard, you would just be pointing it to another tileset in the currently loaded map. If it is hard let me know. If you don't want to do it let me know if there's a way I could do it myself?

Anyways thanks again for the great library!
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 easiest way would probably be to swap out the image on the tilesets after you load them.

Code: Select all

-- Switch a skin. The skin parameter is a table that has images for all of the different tilesets indexed by their name.
local function reskin(map, skin)

    -- Switch all of the tileset images to new skins but only if they exist
    for tilesetName, tileset in pairs(map.tilesets) do
        if skin[tilesetName] then
            tileset.image = skin[tilesetName]
        end
    end

    -- Clear all of the sprite batches. They use the old images. New ones will automatically be created.
    for layerName, layer in pairs(map.layers) do
        if layer.class == "TileLayer" then layer._batches = {} end
    end

    -- Force a redraw of the sprite batches.
    map:forceRedraw()
end

-- Load the map
local map = Loader.load("myMap.tmx")

-- Suppose these were full of images for the tilesets
local night = {} 
local day = {}

-- Switch all tiles to night time
reskin(map, night)

-- Switch all of the tiles to day time.
reskin(map, day)
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 »

Advanced Tiled Loader has been updated to 0.12.0.

It is now possible to save maps! In addition you can now set ATL properties inside of Tiled itself.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Advanced Tiled Loader - Updated to 0.12.0!

Post by Karai17 »

Oh wow, both of those features are awesome! I feel like now we can use ATL to create a living-world MMO-type game where players can interact directly with the world and if a server resets, all changes aren't lost :)

Is the world save very resource intensive? Would there be any noticeable lag during a world save event?
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.12.0!

Post by Kadoba »

I would also like to note that the saved maps are saved as "csv" and are uncompressed. This is because the current library I use for zlib/gzip only decompresses. If anyone could find me a pure-lua library/script that can compress into zlib/gzip I would be grateful.
Karai17 wrote:Oh wow, both of those features are awesome! I feel like now we can use ATL to create a living-world MMO-type game where players can interact directly with the world and if a server resets, all changes aren't lost :)

Is the world save very resource intensive? Would there be any noticeable lag during a world save event?
It depends on what you mean by MMO-type and how you plan to structure your game. Maps have to be serialized into an uncompressed XML document which is very slow and large on the disk (comparatively). It's perfectly fine for most single player games, but you're going to run into issues if you want to quickly save entire multiplayer living game worlds.

If you're going to have the time and resources to make a large game like that you might want to make your own data format. If you take that route then you could use the provided save feature now and easily substitute your own later. Who knows, maybe it will be fast enough for your needs.
User avatar
KingRecycle
Prole
Posts: 44
Joined: Thu May 24, 2012 1:01 am

Re: Advanced Tiled Loader - Updated to 0.12.0!

Post by KingRecycle »

I feel like I saw this but I can't find it.

Is there a way to not draw a specific layer but keep it's properties?
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader - Updated to 0.12.0!

Post by Kadoba »

KingRecycle wrote:I feel like I saw this but I can't find it.

Is there a way to not draw a specific layer but keep it's properties?
Yes. You can hide a specific layer by setting Layer.visible to false or you can change the map to not draw any object layers by setting Map.drawObjects to false.

Code: Select all

-- Hide a layer
map("MyLayer").visible = false

-- Hide all object layers
map.drawObjects = false
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Advanced Tiled Loader - Updated to 0.12.0!

Post by Karai17 »

A thought. How feasible would it be to use ATL without grid locking? And further on that notion, How feasible would it be to detect collisions with objects without grid locking? For instance, if I have a rock sitting in the middle of a tile, How could I detect only the part of the tile that is not transparent? Would I maybe need semi-complex polygons over top the collision area, or would it be possible to determine if the sprite's opaque pixels are going to collide with the rock's opaque pixels?

I like ATL very much; working with Tiled maps is quite easy and I wouldn't want to lose such a great tool for this thing I am about to start working on.
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 8 guests