Page 1 of 1

love code not working error badd argument #1 to init

Posted: Wed Apr 29, 2015 12:52 pm
by Sir_Titas
hey guys
im pretty new to love2d and am having some trouble with loading external code into my project

here is my code

Code: Select all

love.filesystem.init()
main = love.filesystem.load('data/main.lua')()
and here is my error

Code: Select all

Error

main.lua:1:bad argument #1 to 'init'(string expected, got no value)

traceback

[C]: in function 'init'
main.lua:1: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'

Re: love code not working error badd argument #1 to init

Posted: Wed Apr 29, 2015 2:04 pm
by Nixola
Just drop the first line. [wiki]love.filesystem.init[/wiki] is automatically called by LÖVE, when needed, you don't have to call it to have it working