DarthDie
Prole
Posts: 2
Joined: Wed Sep 14, 2011 7:11 pm

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)

DarthDie
Prole
Posts: 2
Joined: Wed Sep 14, 2011 7:11 pm

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 ...

Nergal
Prole
Posts: 7
Joined: Thu Oct 06, 2011 5:51 pm

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!

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
explode.lua
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..."

Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

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?

Nergal
Prole
Posts: 7
Joined: Thu Oct 06, 2011 5:51 pm

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..."

jondoe
Prole
Posts: 4
Joined: Sat Oct 22, 2011 2:07 pm

Nergal, I think I found an error in your code, it didn't run together with the examples without it.

Code: Select all

if love.filesystem.exists(filename) and love.filesystem.isFile(filename) then

on line 68 of Loader.lua should be

Code: Select all

if love.filesystem.exists(Loader.path .. filename) and love.filesystem.isFile(Loader.path .. filename) then
Awesome library, will most definitely use it in my game. Thanks!

Nergal
Prole
Posts: 7
Joined: Thu Oct 06, 2011 5:51 pm

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.
"There would come a time I'd wake at night, and the possibilities before me were like so many dark doors..."

oldtopman
Prole
Posts: 4
Joined: Sat Nov 05, 2011 12:24 am

I put up a simple tutorial page on the wiki here.
require("witty.signature")
end

function love.draw()
signature:draw()
end

legendman3
Citizen
Posts: 68
Joined: Sun Jan 22, 2012 8:29 pm

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

legendman3
Citizen
Posts: 68
Joined: Sun Jan 22, 2012 8:29 pm