Page 1 of 1

Can't launch love 2d

Posted: Fri Jul 30, 2021 7:42 am
by Cffex
I'm new to love 2d, so I've read the getting started page and they said make a folder that has a main.lua in it and drag that folder onto love 2d shortcut when I try to drag it getting this error: https://love2d.org/forums/download/file ... w&id=20021
also the main.lua is a document file open with note pad

Re: Can't launch love 2d

Posted: Fri Jul 30, 2021 3:29 pm
by GVovkiv
Since you new, you, probably, don't want to deal with thing like that, so you can try zerobrane
https://studio.zerobrane.com/
Install it, open, in upper bar choose Project-->Lua Interpreter-->Love
(If you install love in default folder, now you don't need do anything else)
And now you ready to work

Re: Can't launch love 2d

Posted: Fri Jul 30, 2021 6:01 pm
by ReFreezed
Create a file called "whatever.cmd" next to your main.lua with this line in it:

"C:\Program Files\LOVE\lovec.exe" .

(Change the directory if you've installed LÖVE elsewhere.)
Now you can run the game by running whatever.cmd .

(Installing ZeroBrane will do nothing but complicate things.)

Re: Can't launch love 2d

Posted: Fri Jul 30, 2021 6:10 pm
by GVovkiv
ReFreezed wrote: Fri Jul 30, 2021 6:01 pm (Installing ZeroBrane will do nothing but complicate things.)
Yeah, better to use some notepad++, add some cmd files or lauch options(hi NppExec), which doesn't even support function list, doesn't have auto-completion and other stuff for lua without using plugings, but even if you find them:
"Oh, hey, nice plugin, it add auto-completion for love!
Oh... it was updated 3 years ago and support love 10"
Or using some notepad.exe and bat files
Or run love through cmd window itself

Yeah, all that methods better, especially when you new to something, in that case, to love

Better, that:
Install Zerobrane
Open it
Switch interprier to "Love" which i mention earlier
Create or open folder with main.lua
Press f6 to lauch it anytime
Ejoy using nice lua and love IDE with love auto-completion, function list, syntax highlight, in-app console, function description and other out-of-box

Yeah, very complicated

Re: Can't launch love 2d

Posted: Fri Jul 30, 2021 6:58 pm
by ReFreezed
@GVovkiv
I'd say making a file and copy-pasting one short line of text in it is less complicated than installing and learning a completely new program. I'm not saying using something other than Notepad is bad - it's just overkill to solve this simple problem of "how do I run the game".

Re: Can't launch love 2d

Posted: Fri Jul 30, 2021 7:07 pm
by GVovkiv
ReFreezed wrote: Fri Jul 30, 2021 6:58 pm @GVovkiv
I'd say making a file and copy-pasting one short line of text in it is less complicated than installing and learning a completely new program. I'm not saying using something other than Notepad is bad - it's just overkill to solve this simple problem of "how do I run the game".
Nope
In that case, it's only for better
From what i can guess, OP kinda new to programming and love itself
(Since i don't see any real reason, why op using notepad for editing)
So it be more beneficial for OP to learn nice IDE and lua\love in both time

I don't think suffering with notepad + bat file it's less complicated, then using IDE

Re: Can't launch love 2d

Posted: Sat Jul 31, 2021 12:43 pm
by zorg
GVovkiv wrote: Fri Jul 30, 2021 7:07 pm
ReFreezed wrote: Fri Jul 30, 2021 6:58 pm @GVovkiv
I'd say making a file and copy-pasting one short line of text in it is less complicated than installing and learning a completely new program. I'm not saying using something other than Notepad is bad - it's just overkill to solve this simple problem of "how do I run the game".
Nope
In that case, it's only for better
From what i can guess, OP kinda new to programming and love itself
(Since i don't see any real reason, why op using notepad for editing)
So it be more beneficial for OP to learn nice IDE and lua\love in both time

I don't think suffering with notepad + bat file it's less complicated, then using IDE
Unless, *gasp* they don't need one? Besides, that wasn't the original question either.

If the OP dragged the folder with main.lua inside, even if it was empty, a black screen would be showing instead of that error.

Re: Can't launch love 2d

Posted: Sat Jul 31, 2021 1:47 pm
by GVovkiv
Unless, *gasp* they don't need one? Besides, that wasn't the original question either.

If the OP dragged the folder with main.lua inside, even if it was empty, a black screen would be showing instead of that error.
Or unless *gasp* they don't know about, for example, love and more specific lua IDE, which may make life with it easer?
And maybe it's reason why they ask that question?
Sometimes, people try do deal with wrong problems in wrong way, and it looks like that is one of them

Re: Can't launch love 2d

Posted: Sun Aug 01, 2021 12:25 am
by pgimeno
FWIW I only get that error when neither main.lua nor conf.lua are in the folder that I pass to love.

Code: Select all

$ love11 .
Error: [string "boot.lua"]:575: No code to run
Your game might be packaged incorrectly.
Make sure main.lua is at the top level of the zip.
stack traceback:
	[string "boot.lua"]:777: in function <[string "boot.lua"]:773>
	[C]: in function 'error'
	[string "boot.lua"]:575: in function <[string "boot.lua"]:380>
	[C]: in function 'xpcall'
	[string "boot.lua"]:787: in function <[string "boot.lua"]:780>
	[C]: in function 'xpcall'
$ 
It appears to me that the OP must have made a mistake somehow. Like creating a folder in the same folder as main.lua and passing that one instead of the one that contains it.