Distributing your games (making a .love file)

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.
Posts: 11
Joined: Sun Feb 20, 2011 2:03 pm

Re: Distributing your games (making a .love file)

Post by obur »

a blank command prompt pops up, then disappears, but nothing happens. a "nogame" animation didn't come this time. blank window comes and disappears, that's all. uhm. i don't want to disturb you guys, but yeah, i can't do it.
i also tried this stuff in my homemate's computer which is win7.
thanks for all your help. i hope no one is cursing me :P
User avatar
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France

Re: Distributing your games (making a .love file)

Post by TsT »

BlackBulletIV wrote:For a Linux and Mac friendly version, here's a Ruby script.
Make sure you're in the project directory when executing, and that you provide a filename for the .love file (with or without the extension).

Code: Select all

#!/usr/bin/env ruby

if ARGV.length == 0
    print "Usage: ./make_love_file.rb love_file_location\n"
    print "Make sure you are in the project folder when using this command..\n"
    exit 0

unless File.exists? 'main.lua'
    print "Directory does not contain a main.lua file.\n"
    exit 1

if ARGV[0]
    file = ARGV[0]
    file += '.love' unless file.end_with? '.love'
    `zip -r #{file} *`
    if $?.exitstatus == 0
        print "#{ARGV[0]}.love created successfully.\n"
        print "An error occurred file creating the file.\n"
    print "Please give a name for the .love file.\n"
    exit 1
EDIT: On Mac OSX, a cool thing to do is add this to your ~/.bash_profile file:

Code: Select all

alias lovemake="path/to/where/you/placed/script.rb"
Then you can execute like this from anywhere:

Code: Select all

lovemake LoveFileName
I see your script and decide to do equivalent to shell (because I'm sure to have a sh environnement, not always a ruby one).
I change to my use.

Code: Select all


if test $# -eq 0; then
        echo >&2 "Usage: $(basename "$0") <option|love_file_location>"
        echo >&2 "   dev      make a currentdir-YYYYMMDD-HHMMSS.love file"
        echo >&2 "   release  make a currentdir-YYYYMMDD.love file"
        echo >&2 "   auto     see dev"
        echo >&2 "   clean    remove the current *.love files"
        echo >&2 "Make sure you are in the project folder when using this command."
        exit 1

if test ! -f "main.lua"; then
        echo >&2 "Directory does not contain a main.lua file."
        exit 2

if test -z "$1"; then
        echo >&2 "Please give a name for the .love file."
        exit 2

case "$1" in
                file="$(basename "$(pwd)")"-`date +%Y%m%d-%H%M%S`.love
                # calculate the current day (before sleeping)
                # like the day is changing at 5h!
                day=`date -d "-5 hours" +%d`
                file="$(basename "$(pwd)")"-`date +%Y%m`${day}.love
                rm -i -- *.love
                exit 0
                file="$1" ; shift
                if echo "$file" | grep -q -v -- '\.love$'; then

if test $verbose -eq 0; then

if test -f .release.ignore; then

zip $QUIET -r "$file" * -x "*.love" -x "$file" -x .release.ignore $IGNORE
if test $ret -ne 0; then
        echo >&2 "An error occurred file creating the file."
        exit $ret

echo "File created successfully : $file"
Usage :

Code: Select all

lovemake test
Produce a test.love file

Code: Select all

lovemake release
If you run it in /home/USER/love2d/toto/
It Produce a toto-20110429.love file (the date in YYYYMMDD format)

Code: Select all

lovemake dev
If you run it in /home/USER/love2d/toto/
It Produce a toto-20110429-193817.love file (the date in YYYYMMDD-HHMMSS format) to get a unique name for devel.

My lovemake also use a hiden file (named .release.ignore) as list of exclusion.
By this way you can build your love file without some test files easily.

Have fun!
EDIT: bug fixed
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)
Posts: 5
Joined: Wed Sep 28, 2011 10:47 pm

Re: Distributing your games (making a .love file)

Post by knarF.se »

Hi, I uses this commando to package .love-files.

Code: Select all

echo My LÖVE precious game! | zip -zr9n .png:.jpeg:.jpg ../${PWD##*/}.love ./*
It is supposed to be executed from the ‘build’-directory (Where all files resides as they should, for distribution). It probably works on most *nix systems, including MachOSX.

The ‘-n .png:.jpeg:.jpg’-thingie prohibits compression of PNG- and JPEG-files (They are already compressed you know).

About the 16 pages in this thread, Teal Deer for now, Will probably read 'em later when I've got a more complex LÖVE-project and needs to compose a good script build-/debug-/test-/distribute-script (also the zip-command seems have good preferences 'bout symlinks).
Posts: 34
Joined: Fri Sep 24, 2010 5:46 am

Re: Distributing your games (making a .love file)

Post by luminosity »

I've been working on my game for a while now, for commercial distribution at the end. At the moment I'm focused on Windows, though I'll be making a linux and mac version later. This meant amongst other things I didn't want to need to have users install the framework in addition to installing my game, and I definitely didn't want to override previously installed versions, or have future installed versions break my game.

At the same time, though, I didn't want to make a love.exe mygame.love merge -- I've programmed my game to do a lot of its loading by iterating over directories or files to load campaign files, or unit files, so I can easily drop in future campaigns, and hopefully users will be able to as well to create easy mods, etc.

So what I hit upon playing around today was:
  • make an export of the game files for my game
  • copy the love framework files on my computer to a LOVE sub directory of my game
  • add a quick and dirty batch file that just contains "LOVE/love.exe ."
  • convert that to an exe so I can make a fancy icon using this nifty program
Running the game works fine on my computer (win 7) with LOVE installed, and also on my brother's computer (XP) which doesn't have it installed. Everything seems to be working fine. I just thought it'd be a good idea to check if there could be any problems distributing my game like this?

User avatar
Solid Snayke
Posts: 2930
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada

Re: Distributing your games (making a .love file)

Post by slime »

Why don't you just use the love.filesystem save directory for mod/campaign/data files?
User avatar
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands

Re: Distributing your games (making a .love file)

Post by Robin »

Like slime said. Also, the way you're doing it may require administrative rights to add addons, mods, etc., which might not be what you want.

Doing it in the save dir, you can have a simple installer which doesn't need administrative rights, so each user can download their own new campains or mods.
Help us help you: attach a .love.
User avatar
Posts: 85
Joined: Mon Feb 27, 2012 5:11 am

Re: Distributing your games (making a .love file)

Post by sanjiv »

Help? I've made .love files before, but all of a sudden this guy's refusing to run.

1) The folder with the main.lua, when dragged over the LOVE shortcut, runs just fine. (whoray!)

2) I move the contents of the folder (not the folder itself) into an empty zip file and rename the file to love (with main.lua at the root). (as usual)

3) I double click on the love file, and get nothing but LOVE and stars. (huh?)

Is there some rule I'm not following, or something particularly weird thing I've included in that folder? I'll admit there's a lot of extra and unused stuff in there, but I can't figure out what'd be getting in the way.

The love file I attached won't run, but if you convert it to zip and get it into a folder, it should run just fine.
Collision vFail.love
A failed code that runs when in folder, but not when converted to .love
(26.56 KiB) Downloaded 295 times
User avatar
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Distributing your games (making a .love file)

Post by Nixola »

I renamed 'detect collisions' to 'detect_collisions' and it works, so I'd say that LÖVE doesn't like spaces... But then I noticed 'start point' (didn't rename it and it works anyway...)
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Posts: 85
Joined: Mon Feb 27, 2012 5:11 am

Re: Distributing your games (making a .love file)

Post by sanjiv »

That doesn't seem to be fixing things on my end. I went ahead and removed all the spaces from all file names, and still, no dice. Just so people don't have to open the whole thing to look at it, here's my main.lua. I assume if there's an obvious problem,this is where it'll be.

Code: Select all

require ('colors')
require ('level')
require ('player.player')
require ('player.moveplayer')
require ('collisions')
require ('level.impermeableobjects')
require ('startpoint')
require ('message')

function love.load()



function love.update(dt)
		if boxCollision(player,object,dt)
		then collision=boxCollision(player,object,dt) 
		else collision='-' end


function love.draw()



--	for i=1,#object do	
--	end
	love.graphics.print("title? Perhaps I'll use these to keep track of progress",60,30)
	love.graphics.print(player.x..', '..player.y,10,10)
	love.graphics.print(collision, 10,30)


function love.mousepressed(x,y,button)
	if button=='l' then

function love.keypressed(key,unicode)
	if key==' ' then player.vy=-player.jump_v end
	if key=='return' then player.x=startpoint.x player.y=startpoint.y end


User avatar
Posts: 85
Joined: Mon Feb 27, 2012 5:11 am

Re: Distributing your games (making a .love file)

Post by sanjiv »

update: Best I can tell, my mistake was creating and renaming a rar file instead of a zip file. Things work fine now.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 27 guests