require parent dir - sandboxing...

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
gfreak
Prole
Posts: 29
Joined: Wed Jan 04, 2012 5:32 pm

require parent dir - sandboxing...

Post 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!
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: require parent dir - sandboxing...

Post 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
Kurosuke needs beta testers
gfreak
Prole
Posts: 29
Joined: Wed Jan 04, 2012 5:32 pm

Re: require parent dir - sandboxing...

Post by gfreak »

yes, thanks
a fake main with only

require "code/main"

do the trick
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: require parent dir - sandboxing...

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

Who is online

Users browsing this forum: Google [Bot] and 218 guests