Guess what? When I unzip it, there are no problems.
This has happened a lot of times before, mostly with middleclass, although it seems to be more of a "can't require in subdirectories" issue.
Strangely, moving middleclass.lua to the main folder and changing the first require to "middlclass" fixes it, even though the middleclass-extra files are still in "lib/middleclass-extra"...
Pig Command
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Pig Command
Help us help you: attach a .love.
- TechnoCat
- Inner party member
- Posts: 1612
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: Pig Command
I'm willing to bet just doing require 'lib/middleclass/init' will fix it, but I want to load the module package in the correct Lua way.Robin wrote:Guess what? When I unzip it, there are no problems.
This has happened a lot of times before, mostly with middleclass, although it seems to be more of a "can't require in subdirectories" issue.
Strangely, moving middleclass.lua to the main folder and changing the first require to "middlclass" fixes it, even though the middleclass-extra files are still in "lib/middleclass-extra"...
Re: Pig Command
I thought it was looking for the file middleclass.lua. But maybe it's init.lua. I've never seen the syntax "require lib.middleclass" before.TechnoCat wrote:Well, lib/middleclass is the directory, so shouldn't it be looking for lib/middleclass/init.lua? http://www.lua.org/manual/5.1/manual.ht ... ge.loaders
hint: It finds it on the other systems.
Also, why have I never come across this before? Something is fishy in pigland.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
- TechnoCat
- Inner party member
- Posts: 1612
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: Pig Command
As stated by PiL:T-Bone wrote: I thought it was looking for the file middleclass.lua. But maybe it's init.lua. I've never seen the syntax "require lib.middleclass" before.
the search for a Lua file for module foo will try to open the files ./foo.lua, ./foo.lc, and /usr/local/foo/init.lua, in that order.
Re: Pig Command
I guess LÖVE only supports that in .love-files on some systems. Or perhaps it's the part about using dots for folders that confuses it?TechnoCat wrote:As stated by PiL:T-Bone wrote: I thought it was looking for the file middleclass.lua. But maybe it's init.lua. I've never seen the syntax "require lib.middleclass" before.the search for a Lua file for module foo will try to open the files ./foo.lua, ./foo.lc, and /usr/local/foo/init.lua, in that order.
Besides, it doesn't say that it checks ./foo/init.lua, which it actually seems to do...?
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Pig Command
No slashes in require. No. Periods are correct.
As for the /init.lua, that has been in love since 0.7.0 (at least, I cba to check any further back). That said, I remember changing the loader for 0.8.0, so maybe that behaves better?
As for the /init.lua, that has been in love since 0.7.0 (at least, I cba to check any further back). That said, I remember changing the loader for 0.8.0, so maybe that behaves better?
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Pig Command
For the record, on the next version of middleclass, I'll ditch the init.lua file entirely; you will just use the middleclass.lua file. This will hopefully sidestep these issues.
When I write def I mean function.
Who is online
Users browsing this forum: No registered users and 4 guests