Director Problem!

I keep getting this error with director. one file director works, the next file it doesn’t (for scene changes) I think I’ve done it all right and I can’t see a problem…

Please help…

Runtime error ...inistrator\Desktop\CoronaProjects\Flick\director.lua:268: attempt to index a boolean value stack traceback: [C]: ? ...inistrator\Desktop\CoronaProjects\Flick\director.lua:268: in function 'loadScene' ...inistrator\Desktop\CoronaProjecspawn spawn

Thanks. [import]uid: 68047 topic_id: 11968 reply_id: 311968[/import]

Every time I have gotten this error it has always been a problem with my code and nothing to do with the director class. Usually for me it is a line or two of code I forgot to add or delete. [import]uid: 27965 topic_id: 11968 reply_id: 43643[/import]

I know, what I meant was the director things aren’t working because of code, but it appears to be right, the code, but the error doesn’t really help me find the error AT all. [import]uid: 68047 topic_id: 11968 reply_id: 43648[/import]

Could you post your code so I can try to help? [import]uid: 27965 topic_id: 11968 reply_id: 43649[/import]

Yes director hides the usual terminal output and replaces it with it’s own useless pop up and error messages… not telling where or what the errors are.
I usually build my individual scenes without director and put them into director when i am sure they have no errors.

Director is still a great tool though! [import]uid: 13632 topic_id: 11968 reply_id: 43652[/import]

Ok, I’ll pastebin my code.

MAIN.LUA http://pastebin.com/0FWaGF1G

GAME.LUA http://pastebin.com/wuV05Hi8

Few things in game.lua I’m working on that may have errors, but the director thing is still a problem. [import]uid: 68047 topic_id: 11968 reply_id: 43653[/import]

OH and by the way, the main thing I need fixing is the alert’s director change. [import]uid: 68047 topic_id: 11968 reply_id: 43658[/import]

Anyone? [import]uid: 68047 topic_id: 11968 reply_id: 43664[/import]

I took a quick look.
I don’t know if this is the solution but you need to put your game.lua in a module like this:

module(…, package.seeall)

otherwise everything in game.lua will be global.

another thing: I would put all the code in game lua inside the new() function.
director 1.3 comes with a template for scenes… you should take a look at that.

Hope this helps

[import]uid: 13632 topic_id: 11968 reply_id: 43666[/import]

OK, when I tried the module thing everything stops working, but I got the module thing working with game.lua eventually. However, I am still getting errors like Runtime error ...\Administrator\Desktop\CoronaProjects\Flick\game.lua:73: attempt to c all method 'insert' (a nil value) stack traceback: [C]: in function 'insert' ...\Administrator\Desktop\CoronaProjects\Flick\game.lua:73: in function '\_listener' ?: ispawn Runtime error ...inistrator\Desktop\CoronaProjects\Flick\director.lua:183: attempt to call method 'removeSelf' (a nil value) stack traceback: [C]: in function 'removeSelf' ...inistrator\Desktop\CoronaProjects\Flick\director.lua:183: in function 'cleanGspawn spawn

which appears to be with the groups. ^^^ that one starts as soon as I click start, so maybe I am not removing the groups properly? Or maybe my code in game.lua for inserting stuff is allll in the wrong order?

ARGH, please help. Thanks :slight_smile:

[import]uid: 68047 topic_id: 11968 reply_id: 43671[/import]

with director, make sure you’re using the right function calling methods.
I’ve had a lot of problems with object.function(var) and object:function(var)
usually because of the self reference that goes with : [import]uid: 34945 topic_id: 11968 reply_id: 43680[/import]