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.
GresTW
Prole
Posts: 1
Joined: Tue Jul 10, 2012 7:03 am

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

Post by GresTW »

Kaze wrote:I just drag my game folders onto my batch script, "Make LOVE.bat". :nyu:
Well that's just so obvious...why didn't I think of it!
clepto
Prole
Posts: 35
Joined: Wed Jul 25, 2012 10:20 pm

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

Post by clepto »

for linux i have created a nautilus script to create a .love file from the current directory
you must have zip installed to work, the script is this

Code: Select all

#!/bin/bash

cd $NAUTILUS_SCRIPT_CURRENT_URI
zip -r game.love *
copy/paste into a file and give it executable rights, you must have nautilus installed and nautilus-actions (i am not sure about the name), then move the file to ~/.gnome2/nautilus-scripts/

go into the games folder and right click and you will a option "scripts" or something similar
User avatar
WolfNinja2
Party member
Posts: 150
Joined: Wed Oct 24, 2012 10:10 pm

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

Post by WolfNinja2 »

anytime i try to make a .love by zipping my game, I try to run it and all i get is rubber piggeh... i do love this pig but still a bit annoying haha
User avatar
Nixola
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 »

Could you try again to .zip (don't .rar or .7z it! zip it!) your game and upload it here?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
sexybiggetje
Prole
Posts: 1
Joined: Tue Dec 11, 2012 11:41 am

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

Post by sexybiggetje »

I see all these auto package script here.
For my game I wrote the following ant script which packages Win / Mac packages (and creates a .dmg for it).

The version below is quite generic, but expects your game to reside in "game", a plist (in package), icon (in package) and love binaries (in love2d) to be present. For the rest you will need to replace all occurrences of "mygame" with your own project name ofcourse. It is meant to run on os x (hence it doesn't run reshacker yet for the windows binary, and it used hdiutil to create the dmg).

This was the first build script, haven't gotten around to making a more generic one which you can invoke on just a folder.
Might be useful for someone else.

Code: Select all

<project>
	<target name="package">
		  <zip destfile="mygame.love"
		       basedir="game"
		       excludes="**/.DS_Store, **/.dropbox"
		  />
		  
		  <!-- Windows x86 -->
		  
		  <mkdir dir="mygame-win-x86" />
		  <mkdir dir="mygame-win-x86/love2d" />
		  
		  <copy todir="mygame-win-x86">
			  <fileset dir="love2d/love-0.8.0-win-x86">
				  <include name="**/*.dll" />
				  <include name="love.exe" />
			  </fileset>
		  </copy>
		  <copy todir="mygame-win-x86/love2d">
			  <fileset dir="love2d/love-0.8.0-win-x86">
				  <include name="**/*.txt" />
			  </fileset>
		  </copy>
		  
		  <exec executable="cat" output="mygame-win-x86/mygame.exe">
			  <arg value="mygame-win-x86/love.exe" />
			  <arg value="mygame.love" />
 		  </exec>
		  
		  <delete file="mygame-win-x86/love.exe" />

		  <zip destfile="mygame-win-x86.zip"
		       basedir="mygame-win-x86"
		       excludes="**/.DS_Store, **/.dropbox"
		  />
		  
		  <delete dir="mygame-win-x86" />
		  
		  <!-- Windows x64 -->
		  
		  <mkdir dir="mygame-win-x64" />
		  <mkdir dir="mygame-win-x64/love2d" />
		  
		  <copy todir="mygame-win-x64">
			  <fileset dir="love2d/love-0.8.0-win-x64">
				  <include name="**/*.dll" />
				  <include name="love.exe" />
			  </fileset>
		  </copy>
		  <copy todir="mygame-win-x64/love2d">
			  <fileset dir="love2d/love-0.8.0-win-x64">
				  <include name="**/*.txt" />
			  </fileset>
		  </copy>
		  
		  <exec executable="cat" output="mygame-win-x64/mygame.exe">
			  <arg value="mygame-win-x64/love.exe" />
			  <arg value="mygame.love" />
 		  </exec>
		  
		  <delete file="mygame-win-x64/love.exe" />

		  <zip destfile="mygame-win-x64.zip"
		       basedir="mygame-win-x64"
		       excludes="**/.DS_Store, **/.dropbox"
		  />
		  
		  <delete dir="mygame-win-x64" />
		  
		  <!-- OS X -->
		  <mkdir dir="mygame-osx-universal" />
		  
		  <exec executable="cp" output="/dev/null">
			  <arg value="-r" />
			  <arg value="love2d/love.app" />
			  <arg value="mygame-osx-universal/mygame.app" />
 		  </exec>

		  <copy file="mygame.love" todir="mygame-osx-universal/mygame.app/Contents/Resources" />
		  <copy file="package/Info.plist" todir="mygame-osx-universal/mygame.app/Contents" overwrite="true" />
		  <copy file="package/mygame-icon.icns" todir="mygame-osx-universal/mygame.app/Contents/Resources" overwrite="true" />
		  
		  <exec executable="hdiutil">
			  <arg value="create" />
			  <arg value="./mygame-osx.dmg" />
			  <arg value="-srcfolder" />
			  <arg value="mygame-osx-universal" />
			  <arg value="-ov" />
			  <arg value="-nospotlight" />
			  <arg value="-format" />
			  <arg value="UDZO" />
			  <arg value="-imagekey" />
			  <arg value="zlib-level=9" />
			  <arg value="-volname" />
			  <arg value="My Game" />
		  </exec>
		  
		  <delete dir="mygame-osx-universal" />
	</target>
</project>
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

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

Post by Jasoco »

I just wanted to mention that I just read the OP and noticed in the "Make a ZIP" part it says Mac users might need a program to do it. No, that's incorrect. OS X has had built-in ZIP making for over 10 years.

Also I reported that post above that will hopefully be gone by the time anyone reads this.
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

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

Post by pauljessup »

I have a .bat file that does all sorts of crazy stuff, and talks directly to Notepad++, so I can get the most out of it. All I need to do is put into whatever working directory I have for a project, and it does the rest when I call run->love, or run->build love file, or run->build executable (which does a binary append).

It works by taking in the parent folder name, and then using that as the basis building the zip, naming the .love after the parent folder name, naming the executable after it, etc. So, if you have a love 2d project in a folder called MyLoveGame, stick the .bat file into that directory, and then you can call build.bat run, or build.bat build, etc.

Here are the basic contents, if anyone wants to see how it's done. I have a folder in my root directory for all of my projects called "tools", it has a 32 and 64 bit versions of love in the love32 and love64 respectfully, and it has a 7zip in the main tools directory.

Code: Select all

@echo off

SET "CDIR=%~dp0"
:: for loop requires removing trailing backslash from %~dp0 output
SET "CDIR=%CDIR:~0,-1%"
FOR %%i IN ("%CDIR%") DO SET "PARENTFOLDERNAME=%%~nxi"

SET "CURDIR=%~dp0"
echo %CURDIR%

IF %1 EQU build GOTO buildlove
IF %1 EQU run GOTO run
IF %1 EQU clean GOTO clean
GOTO end

:run
ECHO Running %PARENTFOLDERNAME%
cd %CURDIR%
cd ..\
tools\love32\love.exe %PARENTFOLDERNAME%
goto end

:clean
ECHO Cleaning %PARENTFOLDERNAME% Distributables
cd %CURDIR%
cd ..\distributables
if exist %PARENTFOLDERNAME% rmdir /S /Q %PARENTFOLDERNAME%
cd %CURDIR%
goto end

:buildlove
ECHO Cleaning %PARENTFOLDERNAME% Distributables
cd %CURDIR%
cd ..\distributables
if exist %PARENTFOLDERNAME% rmdir /S /Q %PARENTFOLDERNAME%

ECHO Building Distribution Folders for: %PARENTFOLDERNAME%
cd %CURDIR%
cd ..\tools
XCOPY love32 ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32  /E /C /R /I /K /Y
XCOPY love64 ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%64  /E /C /R /I /K /Y


ECHO Building Love File: %PARENTFOLDERNAME%
cd %CURDIR%
..\tools\7za a -r -tzip ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32\%PARENTFOLDERNAME%.love *.* -x!build.bat -x!darkroast.wkp
..\tools\7za a -r -tzip ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%64\%PARENTFOLDERNAME%.love *.* -x!build.bat -x!darkroast.wkp


copy ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32\%PARENTFOLDERNAME%.love ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%.love 

ECHO Compiling x32 Executable
cd %CURDIR%
cd ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32\
copy /b love.exe+%PARENTFOLDERNAME%.love %PARENTFOLDERNAME%.exe
del love.exe
del %PARENTFOLDERNAME%.love

ECHO Compiling x64 Executable
cd %CURDIR%
cd ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%64\
copy /b love.exe+%PARENTFOLDERNAME%.love %PARENTFOLDERNAME%.exe
del love.exe
del %PARENTFOLDERNAME%.love


ECHO Compiling Zips to Distribute
cd %CURDIR%
cd ..\tools
7za a -r -tzip ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32.zip ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32\*.*
7za a -r -tzip ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%64.zip ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%64\*.*


ECHO Testing Compiled Executable
cd %CURDIR%
..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32\%PARENTFOLDERNAME%.exe
goto end


:end
Last edited by pauljessup on Tue Jul 23, 2013 5:22 pm, edited 1 time in total.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

Use code tags.
User avatar
Eamonn
Party member
Posts: 550
Joined: Sat May 04, 2013 1:29 pm
Location: Ireland

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

Post by Eamonn »

I just love doing this:
puGkkxK.png
puGkkxK.png (35.26 KiB) Viewed 389 times
"In those quiet moments, you come into my mind" - Liam Reilly
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post by Robin »

Eamonn wrote:I just love doing this:
That image is too small, it barely takes up my whole screen.
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: No registered users and 48 guests