Page 1 of 1

require parent dir - sandboxing...

Posted: Mon Apr 09, 2012 7:51 pm
by gfreak
Hello,
i want this dir structur:
* code
** main.lua
* content
** maps
*** map1.lua

and it seems i cant require "../content/maps/map1"
any way around, i really dont want to put all content into code dir.

thanks!

Re: require parent dir - sandboxing...

Posted: Mon Apr 09, 2012 8:22 pm
by tentus
Main.lua has to be in the root directory. You can do this:

Code: Select all

main.lua
* code
** other.lua
* content
** maps
*** map1.lua

Re: require parent dir - sandboxing...

Posted: Mon Apr 09, 2012 8:52 pm
by gfreak
yes, thanks
a fake main with only

require "code/main"

do the trick

Re: require parent dir - sandboxing...

Posted: Thu Apr 12, 2012 1:14 am
by Jasoco
Change it to require("folder.file") without an extension and with a period instead of slash because 0.8.0 will no longer recognize either.