Running love programs (linux)

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
OCDavid
Prole
Posts: 4
Joined: Mon Sep 25, 2017 6:55 am

Running love programs (linux)

Post by OCDavid »

Hello community Dave here :)

So I have decided to make a game and love2d seems like a good place to start. My OS is linuxMint, my text editor is zerobrane studio and I have installed love2d through the repository.

I run a main.lua file by typing "love /folder/name/main.lua" in the terminal, but I just get a screen that says "no game".

Am I missing something?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Running love programs (linux)

Post by bartbes »

Yes, love doesn't run files, it runs games, and those games can either be a directory, or a zipped directory (.love).
Try "love /folder/name" instead.

That also explains why the file needs to be named main.lua to be found ;).
OCDavid
Prole
Posts: 4
Joined: Mon Sep 25, 2017 6:55 am

Re: Running love programs (linux)

Post by OCDavid »

Works like a charm, thanks buddy ;)
sphyrth
Party member
Posts: 260
Joined: Mon Jul 07, 2014 11:04 am
Contact:

Re: Running love programs (linux)

Post by sphyrth »

I prefer running via scripts. But I'm going to be easily sold if you can provide some benefits of running via Terminal.
OCDavid
Prole
Posts: 4
Joined: Mon Sep 25, 2017 6:55 am

Re: Running love programs (linux)

Post by OCDavid »

I might have jumped to conclusions a bit early.

I have been following a short tutorial from the wiki(see link at the bottom) and everything worked just fine until I finished the tutorial. For some reason it stopped working and I now get the following error when I try to run the game.

Error

boot.lua:364: No code to run
Your game might be packaged incorrectly
Make sure main.lua is at the top level of the zip

Traceback

[C]: in function 'error'
[C]: in function 'xpcall'

One moment it was working just fine and the next, not so much. In between all I did was make a todo list in another program and create another main.lua file in another directory. For some reason the new game files is also not accepted since I get the "no game" screen. I am truely clueless since I did absolutely no actions on my computer that should have anything to do with the tutorial game.

@spyrth
I have only been using linux for a few weeks so I'm not saying that using the terminal is better. It's just what I looked up on the web.

http://osmstudios.com/tutorials/your-fi ... art-1-of-3
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Running love programs (linux)

Post by bartbes »

If you're sure the path you're passing contains main.lua (and not in a subdirectory, and it is readable), there is a bug in older versions where the wrong directory is run if your current working directory contains a directory named 'love'. This bug was fixed in 0.10.0 though.
OCDavid
Prole
Posts: 4
Joined: Mon Sep 25, 2017 6:55 am

Re: Running love programs (linux)

Post by OCDavid »

I was having the files like this:

/gamedirectory/assets/pictures
/gamedirectory/bin/main.lua

I just played around creating a .love file and by rearranging the files like this:

/gamedirectory/assets/pictures
/gamedirectory/main.lua

I got the love file working and I can now run the game from the terminal just like before.

I am using the love 0.9.1 version since that was the one linux gave me from the repository so maybe the issue was caused by the bug you mention. I should properly update. :)
Post Reply

Who is online

Users browsing this forum: No registered users and 91 guests