Page 1 of 1

love.filesystem is a MUST in threads

Posted: Sun May 24, 2015 8:23 am
by cohadar
If you do not

Code: Select all

require "love.filesystem"
in threads than user require calls do not work!

Does NOT work

Code: Select all

require "enet"
require "love.timer"
local tank = require "tank" -- fails with module not found
Works!!!?

Code: Select all

require "enet"
require "love.timer"
require "love.filesystem"
local tank = require "tank" -- it works
This is highly non-intuitive, and it is nowhere in documentation.
Either include love.filesystem by default in love threads or put some BIG RED LETTERS in thread doc.

Re: love.filesystem is a MUST in threads

Posted: Sun May 24, 2015 9:13 am
by bartbes
This is mentioned
When a Thread is started, it only loads the love.thread module. Every other module has to be loaded with require.
Though perhaps non-intuitive. It's also been changed for the next version.
cohadar wrote: This is highly non-intuitive, and it is nowhere in documentation.
Either include love.filesystem by default in love threads or put some BIG RED LETTERS in thread doc.
Then isn't it wonderful that having a forum account not only allows you to complain on the forums, but also to edit the wiki?

Re: love.filesystem is a MUST in threads

Posted: Sun May 24, 2015 6:58 pm
by cohadar
What I don't understand is why user require paths in threads don't work if love.filesystem is not included.
I "see" how it can be related, but still, it is extremely non-intuitive.

I updated the thread wiki with a new notice.

Re: love.filesystem is a MUST in threads

Posted: Sun May 24, 2015 8:16 pm
by T-Bone
I'm guessing PhysFS isn't used at all unless you load love.filesystem. No PhysFS, no way to locate files.

Re: love.filesystem is a MUST in threads

Posted: Sun May 24, 2015 8:57 pm
by bobbyjones
I think its because love.filesystem prepends the require path

Re: love.filesystem is a MUST in threads

Posted: Wed May 27, 2015 7:20 am
by Guard13007
bartbes wrote:Though perhaps non-intuitive. It's also been changed for the next version.
Could you / someone who knows explain how it is being changed please?

Re: love.filesystem is a MUST in threads

Posted: Wed May 27, 2015 9:12 am
by bartbes
Right, so as bobbyjones kind of gets, love.filesystem installs a loader for require when it is required. (So it doesn't prepend to the path.)

As for what changed, in 0.10.0 threads will require both love.thread and love.filesystem on launch.