Closed suzumiyasmith closed 2 years ago
Perhaps this is a different request, but an alternative approach to resolving the error presented is to use something like the current_folder
pattern. Changes like:
local Collider = require(... .. '/collider')
local World = require(... .. '/world')
in init.lua or
local current_folder = (...):gsub('%.[^%.]+$', '')
local Collider = require(current_folder .. "/breezefield/collider")
local set_funcs, lp, lg, COLLIDER_TYPES = unpack(require(current_folder .. "/breezefield/utils"))
in world.lua allow for proper relative path resolution with the library in a subdirectory, without updating lua path or making other special accommodations for this lib. That said, I'm not experienced enough with lua to know of any downsides to this approach.
Thanks for bringing this to my attention! I'm sorry I took so long to get to this, I completely lost track of my emails around that time. I like @PartyLich 's solution (which is a neat trick by the way, good find!)
It's been long enough that I don't even remember writing it, but I'm glad it helped!
Currently, it's not quite comfort to install this module on my own love2d project. Simply git clone and copy do not work, which ends in
Error: lib/breezefield/init.lua:13: module 'breezefield/collider' not found:
I have to import collider and world separately if I locate breezefield in a deeper dir.Hence, I'd be really appreciated if an all-in-one file could be provided. I