2

The only way I found out to execute my script with the Love2d framework is to zip all of it and then rename the zip to love. This kinds of take a lot of time for a small modification. Is there a faster way to do it? I tried to command line and I get this error

'love' is not recognized as an internal or external command,
operable program or batch file.

8 Answers 8

5

LÖVE also executes folders if they have the main.lua in them - you can just drag and drop the folder onto the application, or call it from the command line with the folder as the argument if you prefer.

Sign up to request clarification or add additional context in comments.

1 Comment

On Windows, it's referred to as love.exe for command prompt purposes. You'll need to be in the directory the executable is stored in, though.
4

LÖVE runs the contents of a folder if it can find a main.lua in it (Like Bill said).
[Note that it doesn't check subfolders].

There are three ways to run a love2D program, you can:

a) Drag the folder over the love.exe binary/link (This works in Win and *Nix, I don't know about OS X).

b) Navigate to the directory that is one level above the folder and type love [folder containing main.lua]

or

c) Zip it up and rename the .zip to a .love. Then double click the .love file


Option 'b' will fail if the binary is not in the %PATH%(Windows) or $PATH(*Nix) variable

(It will spout an error message like 'love' is not recognized as an internal or external command, operable program or batch file. on windows and bash: love: command not found on linux).

There are two ways to solve this:
(Both require ADMIN/root privileges, )
1) Add the love binary to the PATH variable. Here's how to do this in windows and in linux (In linux you want to do something like this: PATH=$PATH:$HOME/where/ever/you/put/love/)

2) You can add a link to the love2D binary in C:\WINDOWS\system32 or /usr/bin/.
In windows you create a shortcut to the love.exe (wherever you installed it to) and then drag it into C:\WINDOWS\system32. In linux you can run this:
sudo link /path/to/love/binary /usr/bin/love && sudo chmod ugo+rwx /usr/bin/love

I hope this helps!

Sources: Google (the links above), Love2D and my knowledge :D

Comments

2

simple way:

  • create folder /path/to/Game
  • put your files (main.lua, conf.lua, ...) in folder /path/to/Game

you can run script like this:

love /path/to/Game/

or if you use Linux, you can go in folder (cd /path/to/Game) and type just:

love .

(dot means that you want to run it form in folder

Comments

1

I found this to be very helpful when i started. Hope this helps

A Guide to Getting Started With Love2d

1 Comment

It has what you have to do to be able to run the love command
1

If you're using Mac OS, you should run using:

open -a love xxx.love

To recreate a file as .love, you can run in command line:

zip xxx.love file1.lua file2

If you just want to replace a file in .love:

zip -r xxx.love file1.lua

I think this will make your work easier.

Comments

0

I found a simple solution for save time. You have to create a file .bat with this simple command:

del Project.love
7z.exe a Project.zip ..\Project\*
ren Project.zip Project.love

For do this you need to download 7zip and insert this file (file.bat) into the folder of your project. Like this:

Example

Good work!

Comments

0

If you're yousing Notepad++ to write your code, just open your main.lua file, then go to Run and add there this text including quotes:

"Path" "$(CURRENT_DIRECTORY)"

Where Path is a Full path to love.exe. The save it to a key combination and now you can test your code by using this combination in any script at Notepad++.

Comments

0

If you use Sublime Text, you can make a build which runs your application. https://love2d.org/wiki/Sublime_Text

While in Sublime Text press CMD + B or Ctrl + B

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.