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.
Forum rules
Before you make a thread asking for help, read this.
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Automatically converting 0.5.0 games to 0.6.0

Post by qubodup »

When I cd to git://git.assembla.com/castlead.git and run lua ~/hand-holder.lua, I get the following.

Code: Select all

lua: /home/qubodup/hand-holder.lua:247: bad argument #1 to 'setfenv' (number expected, got nil)
stack traceback:
	[C]: in function 'setfenv'
	/home/qubodup/hand-holder.lua:247: in main chunk
	[C]: ?
hand-holder (v0.5) for porting games for LÖVE 0.5.0 to 0.6.0
Am I doing something wrong?

PS: thanks for your effort. If it worked for anybody, it was probably a nice peace of help! :)
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
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

Post by Robin »

It's not supposed to do that. It means one of the required() files can't be loaded for some reason... Maybe the new version that I haven't uploaded yet fixes that?
Help us help you: attach a .love.
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Automatically converting 0.5.0 games to 0.6.0

Post by qubodup »

Unfortunately

Code: Select all

$ lua ~/hand-holder.lua 
hand-holder (v0.5.1) for porting games for LÖVE 0.5.0 to 0.6.0
lua: /home/qubodup/hand-holder.lua:250: bad argument #1 to 'setfenv' (number expected, got nil)
stack traceback:
	[C]: in function 'setfenv'
	/home/qubodup/hand-holder.lua:250: in main chunk
	[C]: ?
Hm, I'm missing some file?

Code: Select all

AUTHORS.txt
conf.lua
LICENSE.txt
main.lua
README.txt
lib/
 clock.lua
 data.lua
 draw_functions.lua
 getheight.lua
 logic.lua
 messages.lua
 sound.lua
 unit_manager.lua
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
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

Post by Robin »

It doesn't make sense. If the file has syntax errors, (i.e. the chunk is nil) it is supposed to give a warning and return, not continue to setfenv...
Help us help you: attach a .love.
User avatar
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

Post by kikito »

Just wondering: maybe it is a lua version issue? Which lua version are you guys (robin & qubodup) using?

Code: Select all

lua -v
When I write def I mean function.
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Automatically converting 0.5.0 games to 0.6.0

Post by qubodup »

Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
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

Post by Robin »

qubodup wrote:Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
Same. I don't think there are many people who use another version. 5.1 is pretty old, and 5.2 isn't released yet.
Help us help you: attach a .love.
User avatar
farvardin
Party member
Posts: 167
Joined: Sat Jun 28, 2008 6:46 pm

Re: Automatically converting 0.5.0 games to 0.6.0

Post by farvardin »

nice script, it helped me.

You could had mousepressed which was replaced by love.mousepressed
User avatar
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

Post by Robin »

farvardin wrote:You could had mousepressed which was replaced by love.mousepressed
It didn't catch that?

EDIT: new version catches all callbacks and fixes all bugs found since last release.
hand-holder.lua
Version 0.5.2
(9.59 KiB) Downloaded 101 times
Help us help you: attach a .love.
User avatar
farvardin
Party member
Posts: 167
Joined: Sat Jun 28, 2008 6:46 pm

Re: Automatically converting 0.5.0 games to 0.6.0

Post by farvardin »

thank you. Maybe you could also edit your first post to warn people about the latest release being at the end of this thread.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], slime and 6 guests