HEEELP! I'm just making a synchronising program, and when i try to run it it crashes!
Update. Now where's miniFS, which used in synchro.lua.
Crash of engine (CoE)
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Crash of engine (CoE)
Last edited by TC1061 on Sun Oct 15, 2017 11:46 am, edited 1 time in total.
Re: Crash of engine (CoE)
Please post the error message you're getting. The package you have attached can't be run because files are missing.
- zorg
- Party member
- Posts: 3444
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Crash of engine (CoE)
Hi and welcome to the forums!
So, let's take it one by one.
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.
So, let's take it one by one.
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.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Crash of engine (CoE)
Yes! Disabling a module simply means it doesn't get required automatically.
Re: Crash of engine (CoE)
Sorry. I'm using LuaFilesystemLibrary. When love2d loads it, the whole framework crashes!
Re: Crash of engine (CoE)
This forum is so good! I posted this topic and got answer in some hours!
Re: Crash of engine (CoE)
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.
Code: Select all
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
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Crash of engine (CoE)
Please don't double (or triple) post, and edit your posts instead. Are you sure your luafilesystem binary is compatible with lua 5.1?
Re: Crash of engine (CoE)
Yes, its compatible. Oh no! LuaJIT isn't compatible with LFS . It's good I found lfs_ffi!!!
YEAH! It's works!! Thank you!
YEAH! It's works!! Thank you!
Sorry, I'll edit posts instead of doubling.
Last edited by TC1061 on Tue Oct 17, 2017 4:23 am, edited 2 times in total.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Crash of engine (CoE)
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.
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.
Who is online
Users browsing this forum: No registered users and 202 guests