Distributing your games (making a .love file)
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Distributing your games (making a .love file)
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
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
Re: Distributing your games (making a .love file)
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).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).
EDIT: On Mac OSX, a cool thing to do is add this to your ~/.bash_profile file: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 end unless File.exists? 'main.lua' print "Directory does not contain a main.lua file.\n" exit 1 end 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" else print "An error occurred file creating the file.\n" end else print "Please give a name for the .love file.\n" exit 1 end
Then you can execute like this from anywhere:Code: Select all
alias lovemake="path/to/where/you/placed/script.rb"
Code: Select all
lovemake LoveFileName
I change to my use.
Code: Select all
#!/bin/bash
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
fi
if test ! -f "main.lua"; then
echo >&2 "Directory does not contain a main.lua file."
exit 2
fi
if test -z "$1"; then
echo >&2 "Please give a name for the .love file."
exit 2
fi
verbose=0
case "$1" in
auto|dev)
file="$(basename "$(pwd)")"-`date +%Y%m%d-%H%M%S`.love
verbose=0
;;
release)
# 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
verbose=1
;;
clean|dist-clean)
rm -i -- *.love
exit 0
;;
*)
file="$1" ; shift
if echo "$file" | grep -q -v -- '\.love$'; then
file="${file}.love"
fi
esac
QUIET=""
if test $verbose -eq 0; then
QUIET="-q"
fi
IGNORE=""
if test -f .release.ignore; then
IGNORE="-x@.release.ignore"
fi
zip $QUIET -r "$file" * -x "*.love" -x "$file" -x .release.ignore $IGNORE
ret=$?
if test $ret -ne 0; then
echo >&2 "An error occurred file creating the file."
exit $ret
fi
echo "File created successfully : $file"
Code: Select all
lovemake test
Code: Select all
lovemake release
It Produce a toto-20110429.love file (the date in YYYYMMDD format)
Code: Select all
lovemake dev
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 ...)
Re: Distributing your games (making a .love file)
Hi, I uses this commando to package .love-files.
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).
Code: Select all
echo My LÖVE precious game! | zip -zr9n .png:.jpeg:.jpg ../${PWD##*/}.love ./*
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).
-
- Prole
- Posts: 34
- Joined: Fri Sep 24, 2010 5:46 am
Re: Distributing your games (making a .love file)
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:
Thanks.
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
Thanks.
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Distributing your games (making a .love file)
Why don't you just use the love.filesystem save directory for mod/campaign/data files?
- 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)
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.
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.
Re: Distributing your games (making a .love file)
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.
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.
- Attachments
-
- Collision vFail.love
- A failed code that runs when in folder, but not when converted to .love
- (26.56 KiB) Downloaded 421 times
Re: Distributing your games (making a .love file)
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
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Distributing your games (making a .love file)
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()
--level.load()
player:load()
note='-'
scale=1.5--1.5
collision=nil
end
function love.update(dt)
startpoint:pulse(dt)
if boxCollision(player,object,dt)
then collision=boxCollision(player,object,dt)
else collision='-' end
player:update(object,dt)
end
function love.draw()
love.graphics.push()
love.graphics.scale(scale)
player:draw()
startpoint:draw()
-- for i=1,#object do
level.drawObject(object)
-- end
color(white)
love.graphics.print("title? Perhaps I'll use these to keep track of progress",60,30)
love.graphics.pop()
color(white)
love.graphics.print(player.x..', '..player.y,10,10)
love.graphics.print(collision, 10,30)
message()
end
function love.mousepressed(x,y,button)
if button=='l' then
player.x=x/scale
player.y=y/scale
end
end
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
end
Re: Distributing your games (making a .love file)
update: Best I can tell, my mistake was creating and renaming a rar file instead of a zip file. Things work fine now.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 2 guests