Page 17 of 28

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

Posted: Tue Jul 10, 2012 7:11 am
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!

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

Posted: Tue Jul 31, 2012 8:33 pm
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

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

Posted: Wed Oct 31, 2012 8:38 pm
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

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

Posted: Wed Oct 31, 2012 8:42 pm
by Nixola
Could you try again to .zip (don't .rar or .7z it! zip it!) your game and upload it here?

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

Posted: Tue Dec 11, 2012 11:49 am
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>

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

Posted: Mon Feb 04, 2013 10:00 am
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.

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

Posted: Tue Jul 23, 2013 1:40 pm
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

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

Posted: Tue Jul 23, 2013 2:15 pm
by bartbes
Use code tags.

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

Posted: Tue Jul 23, 2013 8:52 pm
by Eamonn
I just love doing this:

Image

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

Posted: Tue Jul 23, 2013 9:51 pm
by Robin
Eamonn wrote:I just love doing this:
That image is too small, it barely takes up my whole screen.