Require error after zipping folder into .love file

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Require error after zipping folder into .love file

Post by Robin »

That might also explain why having a directory and a file with the same name + ".lua" fails. On the other hand, it might not.
kikito wrote:I mean, middleclass-extras has been already used in other .love files, hasn't it?
IIRC, I do it like this:

Code: Select all

/
    main.lua
    /middleclass-extras
        /middleclass
Help us help you: attach a .love.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Require error after zipping folder into .love file

Post by kikito »

Mmm.

So what are the options?

Should I rename middleclass & middleclass-extras to something shorter ? I really like 'middleclass' It's got some punch.

The folder layout I'd prefer would be having middleclass-extras is inside middleclass; maybe calling its folder 'extras':

Code: Select all

middleclass/
  |
  +- middleclass.lua
  +- LICENSE.txt
  +- init.lua
  `- extras/ -> middleclass-extras here
So the require would be

Code: Select all

require 'middleclass'
require 'middleclass.extras'
Or is there a flag that can be activated on physfs that prevents this from happening?
When I write def I mean function.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Require error after zipping folder into .love file

Post by Robin »

Oh, by the way, I think you can make require "middleclass" work by renaming init.lua to __init.lua. IIRC it is one of the locations checked.
Help us help you: attach a .love.
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Require error after zipping folder into .love file

Post by thelinx »

Robin wrote:Oh, by the way, I think you can make require "middleclass" work by renaming init.lua to __init.lua. IIRC it is one of the locations checked.
No, it's "init.lua".
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Require error after zipping folder into .love file

Post by Robin »

thelinx wrote:
Robin wrote:Oh, by the way, I think you can make require "middleclass" work by renaming init.lua to __init.lua. IIRC it is one of the locations checked.
No, it's "init.lua".
:ehem: Never mind then.
Help us help you: attach a .love.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Require error after zipping folder into .love file

Post by TechnoCat »

No more talking in tongues __Init__.py
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 5 guests