configure zerobrane on mac

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
DavoMcDavo
Prole
Posts: 2
Joined: Sun Apr 17, 2016 12:22 am

configure zerobrane on mac

Post by DavoMcDavo »

Hi,
I would like to check out Love2d:
- Using El Capitan
- Dowloaded Love and placed it in my applications folder
- In ~/.bash_profile I entered:

Code: Select all

# alias to love
alias love="/Applications/love.app/Contents/MacOS/love"
This is working fine as I can now run love from the terminal
- Installed ZeroBrane and clicked on edit->preferences->settings: system and then entered:

Code: Select all

path.love2d='/Applications/love.app/Contents/MacOS/love'
- Also did the same for settings: user
Try to run the love sample code that comes with ZeroBrane and get the following error message:

Code: Select all

Program starting as '"/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/lua.app/Contents/MacOS/lua" -e "io.stdout:setvbuf('no')" "/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms/LOVE-samples/hello/main.lua"'.
Program 'lua' started in '/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms' (pid: 631).
/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/lua.app/Contents/MacOS/lua: ...s/ZeroBraneStudio/myprograms/LOVE-samples/hello/main.lua:1: attempt to index global 'love' (a nil value)
stack traceback:
	...s/ZeroBraneStudio/myprograms/LOVE-samples/hello/main.lua:1: in main chunk
	[C]: at 0x00001c80
Program completed in 0.02 seconds (pid: 631).
I then created a new main.lua file on the desktop with this code:

Code: Select all

function love.draw()
    love.graphics.print('Hello World!', 400, 300)
end
But get this message:

Code: Select all

Program starting as '"/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/lua.app/Contents/MacOS/lua" -e "io.stdout:setvbuf('no')" "/Users/David/Desktop/lovetest/main.lua"'.
Program 'lua' started in '/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms' (pid: 632).
/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/lua.app/Contents/MacOS/lua: /Users/David/Desktop/lovetest/main.lua:1: attempt to index global 'love' (a nil value)
stack traceback:
	/Users/David/Desktop/lovetest/main.lua:1: in main chunk
	[C]: at 0x00001c80
Program completed in 0.01 seconds (pid: 632).
I've been programming in .Net for a few years, but I want to explore Lua and Love2d, however I got stuck and have limited time in the next couple of days, if someone could assist me that would be great, thanks.

UPDATE:
Hello world works when I run "love" + full path to project folder, for example:

Code: Select all

love /Users/David/Desktop/lovetest
I also read that ZeroBrane should recognize Love2d if you place the Love app in the Applications folder, which I did, so I removed the custom Zerobrane config stuff I added above..
Does that mean that there is a bug in ZeroBrane?
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

Re: configure zerobrane on mac

Post by paulclinger »

@DavoMcDavo, you probably didn't select Love as the interpreter (Project | Lua interpreter | Love). After you do that, you may not need to set `path.love2d`, as you have love installed in the default location, so ZeroBrane Studio should be able to find it there. Also, make sure that the project directory is set to the directory where your main.lua file is. When these two steps are done (interpreter and the project directory), it should work. Paul.
DavoMcDavo
Prole
Posts: 2
Joined: Sun Apr 17, 2016 12:22 am

Re: configure zerobrane on mac

Post by DavoMcDavo »

Yeah that was it, once I changed the interpreter it all started to work.

Thanks a lot, now let's learn some Love2d
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests