Automatically converting 0.5.0 games to 0.6.0
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- luisfcorreia
- Prole
- Posts: 4
- Joined: Sun Jan 10, 2010 4:17 pm
- Location: Belas, Portugal
- Contact:
Re: Automatically converting 0.5.0 games to 0.6.0
sadly no, it didn't help at all.
Luis Correia
http://games.loide.net
http://games.loide.net
Re: Automatically converting 0.5.0 games to 0.6.0
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
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
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Automatically converting 0.5.0 games to 0.6.0
The Wiki page on 0.6.0 is pretty complete I'd say.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!
Oh, right, I'll add that in the next version.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().
I haven't tried it out on NO, I must confess. Will try, though.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!
Help us help you: attach a .love.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Automatically converting 0.5.0 games to 0.6.0
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
Which should have been changed before release IMO.
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'
Help us help you: attach a .love.
Re: Automatically converting 0.5.0 games to 0.6.0
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"]7: in function 'initMap'
[string "main.lua"]:56: in function 'ff'
...ew\love\hand-holder.lua:255: in main chunk
[C]: ?
Any ideas?
Thanks
Matty
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"]7: 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 143 times
Re: Automatically converting 0.5.0 games to 0.6.0
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:
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.
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
Last edited by bmelts on Tue Feb 09, 2010 3:49 pm, edited 3 times in total.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Automatically converting 0.5.0 games to 0.6.0
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).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.
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.
Re: Automatically converting 0.5.0 games to 0.6.0
I'm not sure I follow?
Here's the code in graphics.lua, relevant to what I'm discussing:
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.
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
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Automatically converting 0.5.0 games to 0.6.0
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.
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.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Automatically converting 0.5.0 games to 0.6.0
Yes. I've fixed a few things now.matty wrote:Any ideas?
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.
Help us help you: attach a .love.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests