Zerobrane Love2d debugger error: attempt to index global 'love' (a nil value)

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
inging
Prole
Posts: 2
Joined: Fri Mar 10, 2017 5:27 am

Zerobrane Love2d debugger error: attempt to index global 'love' (a nil value)

Post by inging »

Trying to quickly run some Love2d codes in the local console in Zerobrane

Code: Select all

function love.draw()
    love.graphics.rectangle("fill", 100, 200, 50, 80)
end
but I'm getting this error.

Code: Select all

[string "function love.draw()..."]:1: attempt to index global 'love' (a nil value)
I've already set project > lua interpreter > Love2d.
What am I missing?
User avatar
yetneverdone
Party member
Posts: 446
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Zerobrane Love2d debugger error: attempt to index global 'love' (a nil value)

Post by yetneverdone »

On what OS are you? Make sure the path is correct and installed
inging
Prole
Posts: 2
Joined: Fri Mar 10, 2017 5:27 am

Re: Zerobrane Love2d debugger error: attempt to index global 'love' (a nil value)

Post by inging »

yetneverdone wrote: Fri Mar 10, 2017 6:56 pm On what OS are you? Make sure the path is correct and installed
Oh sorry. OS is Windows 10.
User avatar
yetneverdone
Party member
Posts: 446
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Zerobrane Love2d debugger error: attempt to index global 'love' (a nil value)

Post by yetneverdone »

inging wrote: Fri Mar 10, 2017 9:24 pm
yetneverdone wrote: Fri Mar 10, 2017 6:56 pm On what OS are you? Make sure the path is correct and installed
Oh sorry. OS is Windows 10.
Make sure that the love path is correct
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

Re: Zerobrane Love2d debugger error: attempt to index global 'love' (a nil value)

Post by paulclinger »

inging wrote: Fri Mar 10, 2017 5:31 am Trying to quickly run some Love2d codes in the local console in Zerobrane
I've already set project > lua interpreter > Love2d.
What am I missing?
@inging, you can't run Love code in Local console in ZBS as it's executed by the same interpreter that runs the IDE itself, which doesn't know anything about Love objects (since the error you are getting). What you *can* do is to start a debugging session on a simple (dummy) Love project and then execute Love code in the Remote console. You can modify love.draw and other love handlers from the console (although you can also use Scratchpad/Live coding if you want to test some quick/simple changes). Paul.
Post Reply

Who is online

Users browsing this forum: No registered users and 81 guests