How does Corona handle different LUA files?

Just getting started in Corona, but I do have already a lot of LUA experience. I always worked with Multi Theft Auto, a third party modification for GTA:San Andreas which allows multiplayer functionality, and uses LUA as their scripting language.

But, I already noticed some biiig differences between the MTA and Corona LUA syntax (Especially functionnames :P). Now am I wondering, does Corana collect all files from a folder and it's subfolders, or do I have to require each file like in C++ etc.?

In MTA we got folders called 'resources', and each of these have a XML file in the root folder, indicating which files are being used for the script. I haven't found such a thing in Corona yet, so I would really like to know how Corona does this.

Kind regards, Remi-X.

Hello Remi -X,

I'm not familiar with C++, but Corona uses Modules to handle different LUA files. I come from a php background and it's similar to using require().

Check out this page:
http://developer.anscamobile.com/content/modules

Right, I assume that's the only way. I'll be honest then: that badly sucks! That ruins the flexibleness LUA has, as this is not flexible at all. Reason: why the helllll are those 'module' functions stored in a table? There's a reason why mutiple files are easier, and this thing breaks that completely. Also, according to the notes there, subfolders aren't supported? C'mon, that's no style!

I hope there's another way, otherwise: Corona, do something on it. This is just unbelievable imo.

yeah, everything has to be in the root directory except images. In my current project I have over 120 files in the root - lua files, audio files, sprite sheets, fonts, xml... not pretty - I have ended up adding a lot of prefixes to files to try and keep some organization.

gosh... So, a modification made by 20 (From who 3 - 5 are really active) people who aren't getting paid at all and just do it for the players (which is event open-source!), can deliver better work than a company who has 17 million sells from apps and getting paid for that? No, that's just impossible. Corona SDK developers: Shame on you.

views:1527 update:2011/9/28 9:01:40
corona forums © 2003-2011