Automatically converting 0.5.0 games to 0.6.0

Questions about the LÖVE API, installing LÖVE and other support related questions go here.

Re: Automatically converting 0.5.0 games to 0.6.0

Postby luisfcorreia on Sun Feb 07, 2010 8:51 pm

sadly no, it didn't help at all.
User avatar
luisfcorreia
Prole
 
Posts: 4
Joined: Sun Jan 10, 2010 4:17 pm
Location: Belas, Portugal

Re: Automatically converting 0.5.0 games to 0.6.0

Postby matty on Mon Feb 08, 2010 3:58 am

I'm curious if there is a list of differences that break LOVE filesn (I'm assuming differences from v0.5 to v0.6.x)? It is a bit frustrating trying to pick this up and look at samples from other users when 99% of them seem to either fail with an error or just come up with a black screen!

I've run this script (hand-holder.lua) on several programs, and other than finding game.conf and telling me it should be conf.lua, it doesn't find even simple things, like having love.filesystem.require() instead of just require(). Running against the game "NO", which works fine in v0.6.1, the script throws all sorts of errors. It is all quite confusing!

Thanks
Matty
matty
Prole
 
Posts: 3
Joined: Mon Feb 08, 2010 3:35 am

Re: Automatically converting 0.5.0 games to 0.6.0

Postby Robin on Mon Feb 08, 2010 3:56 pm

matty wrote:I'm curious if there is a list of differences that break LOVE filesn (I'm assuming differences from v0.5 to v0.6.x)? It is a bit frustrating trying to pick this up and look at samples from other users when 99% of them seem to either fail with an error or just come up with a black screen!

The Wiki page on 0.6.0 is pretty complete I'd say.
matty wrote:I've run this script (hand-holder.lua) on several programs, and other than finding game.conf and telling me it should be conf.lua, it doesn't find even simple things, like having love.filesystem.require() instead of just require().

Oh, right, I'll add that in the next version.
matty wrote:Running against the game "NO", which works fine in v0.6.1, the script throws all sorts of errors. It is all quite confusing!

I haven't tried it out on NO, I must confess. Will try, though.
Random remarks are rarely really random. This is a subliminal message. Go read my blog, gvxdev.wordpress.com/.
New Space poll @ http://gvx.github.com/hacking.html#space
User avatar
Robin
The Omniscient
 
Posts: 1801
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands

Re: Automatically converting 0.5.0 games to 0.6.0

Postby Robin on Mon Feb 08, 2010 5:27 pm

Made a whole lot of improvements for require()ing things, check the first post.

Oh, and I tested it with both NO for 0.5 and for 0.6. They both function correctly now, the one for 0.6.1 only warns
Code: Select all
main.lua:11: change require'lua/button.lua' to require'lua.button'
main.lua:12: change require'lua/states.lua' to require'lua.states'

Which should have been changed before release IMO.
Random remarks are rarely really random. This is a subliminal message. Go read my blog, gvxdev.wordpress.com/.
New Space poll @ http://gvx.github.com/hacking.html#space
User avatar
Robin
The Omniscient
 
Posts: 1801
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands

Re: Automatically converting 0.5.0 games to 0.6.0

Postby matty on Tue Feb 09, 2010 3:26 am

Thanks for the link to the wiki.
So, if I look at a single program, let's say Militia Defense Q. I fix the missing conf.lua, I then fix the font issues - it uses love.graphics.newfont(love.default_font), which hand_holder reports as a constant, so I changed it to love._vera_ttf -- is there a replacement for love.default_font?
Next I fixed the requires lines. I re-run hand-holder, and I get this:
hand-holder (v0.5) for porting games for LÖVE 0.5.0 to 0.6.0
C:\Program Files (x86)\Lua\5.1\lua.exe: ...ew\love\
hand-holder.lua:128: attempt to index local 'k' (a number value)
stack traceback:
...ew\love\hand-holder.lua:128: in function
<...ew\love\hand-holder.lua:126>
[string "citymap.lua"]:37: in function 'initMap'
[string "main.lua"]:56: in function 'ff'
...ew\love\hand-holder.lua:255: in main chunk
[C]: ?

Any ideas?

Thanks
Matty
Attachments
mdq.love
(223.69 KiB) Downloaded 9 times
matty
Prole
 
Posts: 3
Joined: Mon Feb 08, 2010 3:35 am

Re: Automatically converting 0.5.0 games to 0.6.0

Postby anjo on Tue Feb 09, 2010 3:06 pm

I don't know anything about hand-holder, but as for love.default_font, it's been replaced with... nothing.

No, really. If you want to use the default font, just pass no font argument to love.graphics.newFont:
Code: Select all
bigFont = love.graphics.newFont(72) -- Default font, 72pt


Also, if you just need the default font at size 12, you don't even need to explicitly create a font - LÖVE will create that font automatically the first time it's needed.
Last edited by anjo on Tue Feb 09, 2010 3:49 pm, edited 3 times in total.
User avatar
anjo
Party member
 
Posts: 245
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin

Re: Automatically converting 0.5.0 games to 0.6.0

Postby kikito on Tue Feb 09, 2010 3:26 pm

anjo wrote:Also, if you just need the default font at size 12, you don't even need to explicitly create a font - LÖVE will create that font automatically the first time it's needed.


I would not recommend that. On the fonts thread we've been discussing about that feature, and it is likely to be changed, according to Rude(link).

So it will be more maintainable to do font = love.graphics.newFont(12), and then love.graphics.setFont(font).
When I write def I mean function.
User avatar
kikito
Party member
 
Posts: 452
Joined: Sat Oct 03, 2009 5:22 pm

Re: Automatically converting 0.5.0 games to 0.6.0

Postby anjo on Tue Feb 09, 2010 3:52 pm

I'm not sure I follow?

Here's the code in graphics.lua, relevant to what I'm discussing:

Code: Select all
love.graphics.print = function (...)
   if not love.graphics.getFont() then
      love.graphics.setFont(love._vera_ttf, 12)
   end
   love.graphics.print1(...)
   love.graphics.print = love.graphics.print1
end

If you don't explicitly set a font before a love.graphics.print(f) call, LÖVE does for you. Once. Once that font is set, it never automatically sets one again. So, you get the overhead of one setFont() in one love.draw() call, and after that, it never bothers you again.
User avatar
anjo
Party member
 
Posts: 245
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin

Re: Automatically converting 0.5.0 games to 0.6.0

Postby kikito on Tue Feb 09, 2010 5:02 pm

Ah I see. I misunderstood. I thought you were talking about love.graphics.setFont(12).

Yes, if you just do love.graphics.print(), whithout creating/loaging any fonts before, then LÖVE will create a default font.
When I write def I mean function.
User avatar
kikito
Party member
 
Posts: 452
Joined: Sat Oct 03, 2009 5:22 pm

Re: Automatically converting 0.5.0 games to 0.6.0

Postby Robin on Tue Feb 09, 2010 5:36 pm

matty wrote:Any ideas?

Yes. I've fixed a few things now.

However, It's not completely fixed. I still get errors. I suggest you temporarily comment out the lines that give problems. I'll upload 0.5.1 soon.
Random remarks are rarely really random. This is a subliminal message. Go read my blog, gvxdev.wordpress.com/.
New Space poll @ http://gvx.github.com/hacking.html#space
User avatar
Robin
The Omniscient
 
Posts: 1801
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands

PreviousNext

Return to Support and Development

Who is online

Users browsing this forum: No registered users and 1 guest