love code not working error badd argument #1 to init

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.
Post Reply
Sir_Titas
Prole
Posts: 1
Joined: Wed Apr 29, 2015 12:42 pm

love code not working error badd argument #1 to init

Post 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'
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

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

Post 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
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 7 guests