love.filesystem is a MUST in threads

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
cohadar
Prole
Posts: 25
Joined: Mon May 04, 2015 5:46 am
Contact:

love.filesystem is a MUST in threads

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: love.filesystem is a MUST in threads

Post 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?
User avatar
cohadar
Prole
Posts: 25
Joined: Mon May 04, 2015 5:46 am
Contact:

Re: love.filesystem is a MUST in threads

Post 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.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: love.filesystem is a MUST in threads

Post by T-Bone »

I'm guessing PhysFS isn't used at all unless you load love.filesystem. No PhysFS, no way to locate files.
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: love.filesystem is a MUST in threads

Post by bobbyjones »

I think its because love.filesystem prepends the require path
User avatar
Guard13007
Party member
Posts: 132
Joined: Sat Oct 25, 2014 3:42 am
Location: Internet, USA
Contact:

Re: love.filesystem is a MUST in threads

Post 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?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: love.filesystem is a MUST in threads

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

Who is online

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