Advanced Tiled Loader - No longer maintained
Re: Advanced Tiled Loader
Hey, I've been setting up ATL to work in my project (which admittedly wasn't at all difficult since my project is very small, but it's a good way to start my post) and I've ran into the problem of objectLayers being empty. I've checked the tmx file its self and it does indeed have an objectgroup node, but for some reason it's empty inside of my map object (table?...not quite used to Lua terminology yet ). Any idearz what might be the problem? (It's likely user error, butte at least now I can have it pointed out)
Re: Advanced Tiled Loader
Heh, nevermind! It was indeed user-error. Map.objectLayers is a dictionary, and I was attempting to loop through it using ipairs...which doesn't work! I switched it over to loop using pairs and it's working just fine now. I'll get the hang of Lua soon enough don't worry ...
Re: Advanced Tiled Loader
Hello,
This is my first post, but I've been lurking the LOVE forums for a while now. I'm extremely impressed with the LOVE engine so far and I very much LOVE Lua. In any case, the community here is excellent and full of helpful posts, so to that end I've decided to make my first post a helpful post as well!
After stumbling upon the Advanced Tiled Loader, I discovered that the newer versions of Tiled Map Editor exports directly to Lua! However, Advanced Tiled Loader still has several useful functions. I've learned a lot from it so far, so I decided to customize Advanced Tiled Loader to load maps directly from .lua files. I've retained backwards compatibility through the two different versions of Tiled Map Editor, as well as retaining the ability to load maps from the .tmx/.lua files. As an added bonus, I've got it set up to load directly from a passed table as well. This way if you are storing your maps some other way, and need to process them in some way (sharing map data via serialized tables over a network maybe?) it can be done as well.
If you see any issues with anything please let me know and I'll be happy to fix it.
I'm using explode from http://lua-users.org/wiki/MakingLuaLikePhp as I like it's simplicity. Because of this you need to make sure you place explode.lua in the external directory of AdvTiledLoader.
Hope this helps someone out!
*edited to fix a couple of bugs, one pointed out by jondoe (thanks!) and another bug with passing the wrong variable for processing lua tables.
This is my first post, but I've been lurking the LOVE forums for a while now. I'm extremely impressed with the LOVE engine so far and I very much LOVE Lua. In any case, the community here is excellent and full of helpful posts, so to that end I've decided to make my first post a helpful post as well!
After stumbling upon the Advanced Tiled Loader, I discovered that the newer versions of Tiled Map Editor exports directly to Lua! However, Advanced Tiled Loader still has several useful functions. I've learned a lot from it so far, so I decided to customize Advanced Tiled Loader to load maps directly from .lua files. I've retained backwards compatibility through the two different versions of Tiled Map Editor, as well as retaining the ability to load maps from the .tmx/.lua files. As an added bonus, I've got it set up to load directly from a passed table as well. This way if you are storing your maps some other way, and need to process them in some way (sharing map data via serialized tables over a network maybe?) it can be done as well.
If you see any issues with anything please let me know and I'll be happy to fix it.
I'm using explode from http://lua-users.org/wiki/MakingLuaLikePhp as I like it's simplicity. Because of this you need to make sure you place explode.lua in the external directory of AdvTiledLoader.
Hope this helps someone out!
*edited to fix a couple of bugs, one pointed out by jondoe (thanks!) and another bug with passing the wrong variable for processing lua tables.
- Attachments
-
- Loader.lua
- Replaces Loader.lua in the AdvTiledLoader directory
- (21.3 KiB) Downloaded 379 times
-
- explode.lua
- Goes in the external directory inside the AdvTiledLoader directory
- (507 Bytes) Downloaded 380 times
Last edited by Nergal on Sat Oct 22, 2011 6:16 pm, edited 2 times in total.
"There would come a time I'd wake at night, and the possibilities before me were like so many dark doors..."
Re: Advanced Tiled Loader
Sorry I didn't see this sooner.
Thanks for your work Nergal. I'm sure this will help some people out. Do you mind if I work your script into the next version?
Thanks for your work Nergal. I'm sure this will help some people out. Do you mind if I work your script into the next version?
Re: Advanced Tiled Loader
For sure Kadoba! I'd be honored!
"There would come a time I'd wake at night, and the possibilities before me were like so many dark doors..."
Re: Advanced Tiled Loader
Nergal, I think I found an error in your code, it didn't run together with the examples without it.
on line 68 of Loader.lua should be
Awesome library, will most definitely use it in my game. Thanks!
Code: Select all
if love.filesystem.exists(filename) and love.filesystem.isFile(filename) then
Code: Select all
if love.filesystem.exists(Loader.path .. filename) and love.filesystem.isFile(Loader.path .. filename) then
Re: Advanced Tiled Loader
Woah! You are absolutely right!
The strange thing is, in my current project it works correctly... I'll bet it has something to do with the way I have my own paths set up though! Regardless you are absolutely correct and that should be set so that we don't have to guess. I suppose I'm just a little bit crazy.
I'll fix the original post. Hopefully Kadoba notices this and updates it as well, if he still intends to work it into the original.
The strange thing is, in my current project it works correctly... I'll bet it has something to do with the way I have my own paths set up though! Regardless you are absolutely correct and that should be set so that we don't have to guess. I suppose I'm just a little bit crazy.
I'll fix the original post. Hopefully Kadoba notices this and updates it as well, if he still intends to work it into the original.
"There would come a time I'd wake at night, and the possibilities before me were like so many dark doors..."
Re: Advanced Tiled Loader
I put up a simple tutorial page on the wiki here.
function love.load()
require("witty.signature")
end
function love.draw()
signature:draw()
end
require("witty.signature")
end
function love.draw()
signature:draw()
end
- legendman3
- Citizen
- Posts: 68
- Joined: Sun Jan 22, 2012 8:29 pm
Re: Advanced Tiled Loader
Hello anyone here? I got a problem while using your library and here is my post in the help section (because i just dont want to copy and paste):
viewtopic.php?f=4&t=7661&p=47683#p47683
viewtopic.php?f=4&t=7661&p=47683#p47683
- legendman3
- Citizen
- Posts: 68
- Joined: Sun Jan 22, 2012 8:29 pm
Re: Advanced Tiled Loader
Hey when i load a map from tiled it doesn't render correctly and just shows a white screen. The map has 3 layers and is 128x128. What could be wrong?
Who is online
Users browsing this forum: No registered users and 8 guests