love.filesystem.include and love.filesystem.require for 0.6

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
Deco
Prole
Posts: 3
Joined: Sun Dec 27, 2009 11:21 am

love.filesystem.include and love.filesystem.require for 0.6

Post by Deco »

Howdy.

I've searched everywhere I could think of. However, I could not find an answer to my questions.

Is there a way to include files and require modules in 0.6?
love.filesystem.include and love.filesystem.require no longer exist, and the global include and require functions never existed.

Help, please! :(
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: love.filesystem.include and love.filesystem.require for 0.6

Post by rude »

Use the standard Lua require, e.g:

Code: Select all

-- foo.lua
require("foo")
Deco
Prole
Posts: 3
Joined: Sun Dec 27, 2009 11:21 am

Re: love.filesystem.include and love.filesystem.require for 0.6

Post by Deco »

Ah, thank you. I had forgotten to remove the '.lua' suffix, and didn't bother reading the error message properly.

Now.. er, how about 'include'? Just use require, perhaps?

I tried dofile, but it keeps saying the file does not exist (both with and without the extension).
Deco
Prole
Posts: 3
Joined: Sun Dec 27, 2009 11:21 am

Re: love.filesystem.include and love.filesystem.require for 0.6

Post by Deco »

Never mind, require works just fine!

Thank you! :D
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: love.filesystem.include and love.filesystem.require for 0.6

Post by bartbes »

Include behavior can be replicated with:

Code: Select all

love.filesystem.load(<file>)()
Geti
Party member
Posts: 112
Joined: Tue Oct 20, 2009 6:38 am

Re: love.filesystem.include and love.filesystem.require for 0.6

Post by Geti »

for the record, is there a reason dofile is gimped?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: love.filesystem.include and love.filesystem.require for 0.6

Post by Robin »

Geti wrote:for the record, is there a reason dofile is gimped?
I guess because it is not used that often?
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: love.filesystem.include and love.filesystem.require for 0.6

Post by bartbes »

Because it just doesn't use love.filesystem, and it doesn't have an easy interface like require has.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests