Page 2 of 2

Re: .love file package/require path

Posted: Sun Jul 24, 2016 9:58 pm
by bartbes
Well, you know, I did implement it. Specifically, love adds a loader, it doesn't replace the lua loaders. And package.path does influence the lua loaders, just not the love's. I know, it's a bit annoying. So in this case, running it unpacked means the lua loaders find it, and I'm betting you're running the .love from the same folder, hence it loading the files from the directory it is in, rather than the .love itself.

As for the source, the loader is defined in https://bitbucket.org/rude/love/src/0.1 ... em.cpp-608, where you can see it calls getRequirePath, rather than reading package.path.

Re: .love file package/require path

Posted: Mon Jul 25, 2016 8:59 pm
by jerluc
@bartbes thanks for the info! And yeah, that makes a lot more sense now. Also, thanks for the link to the source code. Maybe it's just me, but I find that reading the source seems to be way more clarifying and insightful than what some of the wiki docs say.

Re: .love file package/require path

Posted: Mon Jul 25, 2016 9:29 pm
by airstruck
jerluc wrote:Maybe it's just me, but I find that reading the source seems to be way more clarifying and insightful than what some of the wiki docs say.
Just wait til you try love.physics...

Re: .love file package/require path

Posted: Mon Jul 25, 2016 9:33 pm
by slime
airstruck wrote:Just wait til you try love.physics...
http://box2d.org/manual.pdf is decent documentation for love.physics.

Re: .love file package/require path

Posted: Tue Jul 26, 2016 5:48 am
by airstruck
slime wrote:http://box2d.org/manual.pdf is decent documentation for love.physics.
It's great for figuring out how to use Box2D, I've had it open in a tab for weeks. I was talking more about using the wiki as an API reference for love.physics (still needed since the APIs differ and not everything in the Box2D API is exposed to love.physics). There are a lot of undocumented things, and some things are documented that were removed years ago. I've been using the wrap_Foo.cpp source files as API documentation instead of the wiki, since I found myself having to check the source after reading the wiki anyway to be sure the stuff I want to use is actually there, that I'm not overlooking things that aren't documented, and that when the wiki says, for example, that something is measured in meters per second or Newtons, it is actually measured in those units (I've been bitten by all three of those things).

For the most part I think the wiki does a pretty decent job of documenting Love's API, but the love.physics section could be better.

Re: .love file package/require path

Posted: Tue Jul 26, 2016 11:09 am
by slime
airstruck wrote:For the most part I think the wiki does a pretty decent job of documenting Love's API, but the love.physics section could be better.
Indeed! Anyone with a forum account can edit the wiki – please contribute if you're willing and able. :)

Re: .love file package/require path

Posted: Sat Jul 30, 2016 7:24 pm
by airstruck
slime wrote:Indeed! Anyone with a forum account can edit the wiki – please contribute if you're willing and able. :)
Wiki editing is not usually my thing, but I'd be willing to go through and get the love.physics section up to date. I do think love.physics will be infinitely more useful when worlds can be serialized properly, though. I'd like to see what happens with relevant tickets (currently #1191 and #1194) before editing the wiki, so it can all be done in one shot. I'll also do whatever I can to help get those issues resolved.