In conf.lua:
I'm not sure if you can require modules elsewhere if they're disabled here... i know it's possible in threads (except graphics stuff) but i'm not sure if it is on the main thread, to be honest.
In main.lua:
require("lfs") won't work since lfs is not part of vanilla löve, and i don't see you including that with your .love file.
You're calling love.window stuff when you disabled all modules in conf.lua; you can't do that.
Same with love.filesystem.
in synchro.lua:
there's no "end" at the end, that would close your infinite loop.
That's all i could spot on a quick run-through.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
zorg wrote: ↑Sat Oct 14, 2017 6:45 pm
In conf.lua:
I'm not sure if you can require modules elsewhere if they're disabled here... i know it's possible in threads (except graphics stuff) but i'm not sure if it is on the main thread, to be honest.
Yes! Disabling a module simply means it doesn't get required automatically.
And... Even if I disabled a module in conf.lua, I can require it in the game (but if the module is love.event, love.createhandlers must be called). And I made an autoloader, which loads module when it's indexed in the "love" module.
local autoload={}
local win={}
local xxx={}
function autoload.setWindow(t)
if type(t)=="table" then
win=t
end
end
function autoload.fload(n)
return pcall(require,"love."..tostring(n))
end
function autoload.centerize(w,ww,wh)
if w then
-- local ww,wh = w.getMode()
local dw,dh = w.getDesktopDimensions()
print(ww,wh)
print(dw,dh)
print((dw/2)-(ww/2),(dh/2)-(wh/2))
return (dw/2)-(ww/2),(dh/2)-(wh/2)
else
error("bad argument #1 to autoload.centerize!!!")
end
end
local errors={}
function autoload.init(love)
xxx=love
local requires = {
graphics={
{
"image",
function()end
},
{
"window",
function(w) if type(win[3]) ~= "table" then
win[3]={}
end
do
local w2,h2 = w.getDesktopDimensions()
win[3].x = win[3].x or w2-((win[1] or 800)/2)
win[3].y = win[3].y or h2-((win[2] or 600)/2)
end w.setMode(win[1] or 800,win[2] or 600,win[3])
w.setPosition(win[3].x,win[3].y) print(win[3].x,win[3].y)end
}
},
audio={{"sound",function()end}},
}
setmetatable(love,{
__index=function(self,i)
if not errors[i] then
--if requires[i] then
-- for k,v in ipairs(requires[i]) do
-- require("love."..v[1])
-- if v[2] then
-- v[2](self[v[1]])
-- end
-- end
--end
local ok,err = pcall(function()require("love."..tostring(i))end)
if not ok then
errors[i]=true
print(err)end
if rawget(self,"event") then
if self.createhandlers then
pcall(self.createhandlers)
end
end
end
return rawget(self,i)
end
})
end
return autoload
Luajit is binary compatible with lua 5.1, so any library that works with lua 5.1 works with luajit. Note that lua 5.2 and lua 5.3 are not binary compatible with lua 5.1 (or each other).
There's actually another possible issue: love dynamically links the visual c++ runtime, so other libraries you want to use need to dynamically link to (the same version of) the visual c++ runtime.