Crash of engine (CoE)

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
TC1061
Prole
Posts: 32
Joined: Sat Oct 14, 2017 3:50 pm

Crash of engine (CoE)

Post by TC1061 »

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.
Synchro.zip
(99.25 KiB) Downloaded 233 times
Last edited by TC1061 on Sun Oct 15, 2017 11:46 am, edited 1 time in total.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: Crash of engine (CoE)

Post by grump »

Please post the error message you're getting. The package you have attached can't be run because files are missing.
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Crash of engine (CoE)

Post by zorg »

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.
Me and my stuff :3True 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Crash of engine (CoE)

Post by bartbes »

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.
User avatar
TC1061
Prole
Posts: 32
Joined: Sat Oct 14, 2017 3:50 pm

Re: Crash of engine (CoE)

Post by TC1061 »

Sorry. :3 I'm using LuaFilesystemLibrary. When love2d loads it, the whole framework crashes!
Crash.png
Crash.png (314.71 KiB) Viewed 6032 times
lfs.zip
(6.37 KiB) Downloaded 213 times
User avatar
TC1061
Prole
Posts: 32
Joined: Sat Oct 14, 2017 3:50 pm

Re: Crash of engine (CoE)

Post by TC1061 »

This forum is so good! I posted this topic and got answer in some hours!
User avatar
TC1061
Prole
Posts: 32
Joined: Sat Oct 14, 2017 3:50 pm

Re: Crash of engine (CoE)

Post by TC1061 »

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
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Crash of engine (CoE)

Post by bartbes »

Please don't double (or triple) post, and edit your posts instead. Are you sure your luafilesystem binary is compatible with lua 5.1?
User avatar
TC1061
Prole
Posts: 32
Joined: Sat Oct 14, 2017 3:50 pm

Re: Crash of engine (CoE)

Post by TC1061 »

Yes, its compatible. Oh no! LuaJIT isn't compatible with LFS :( . It's good I found lfs_ffi!!!
YEAH! It's works!! :) :) :) Thank you!
bartbes wrote: Sun Oct 15, 2017 2:03 pm Please don't double (or triple) post, and edit your posts instead.
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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Crash of engine (CoE)

Post by bartbes »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 202 guests