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.
.love file package/require path
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: .love file package/require path
@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
Just wait til you try love.physics...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.
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: .love file package/require path
http://box2d.org/manual.pdf is decent documentation for love.physics.airstruck wrote:Just wait til you try love.physics...
Re: .love file package/require path
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).slime wrote:http://box2d.org/manual.pdf is decent documentation for love.physics.
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.
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: .love file package/require path
Indeed! Anyone with a forum account can edit the wiki – please contribute if you're willing and able.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.
Re: .love file package/require path
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.slime wrote:Indeed! Anyone with a forum account can edit the wiki – please contribute if you're willing and able.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 9 guests