Having fun playing with Love, learning Lua and all those fun things. Been playing around with some basic stuff using a couple of Lua files to organize my thoughts, and it's working out reasonably well... until I pack my project into a .love and run it, when it all falls down.
I figure that the integration of PhysFS with the Lua code isn't quite complete, resulting in some issues with things like require().
So... is there a roadmap for the project showing the status of items like this? Should we start using the SourceForge project tracker, which is currently empty?
I'll start hacking at the source if I get a chance and see what I can figure out, but don't anybody hold their breath
Need more Löve for require()...
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Need more Löve for require()...
You should use love.filesystem.require() instead of Lua's standard functions. That should do the trick and let you package your game
Teh Blog -> http://cryodreams.com.ar
Re: Need more Löve for require()...
AHA!
Right, that's what I needed to know.
Are there plans to modify the standard Lua functions to work via PhysFS? Should I just assume that most of the io, os and file stuff is going to disappear and therefore should be avoided where possible?
Right, that's what I needed to know.
Are there plans to modify the standard Lua functions to work via PhysFS? Should I just assume that most of the io, os and file stuff is going to disappear and therefore should be avoided where possible?
Sarcasm - just one of the services I offer.
Re: Need more Löve for require()...
Io, os and file will perish ... as for globals such as require(), it hasn't really been discussed yet.
Re: Need more Löve for require()...
I replaced require with love.filesystem.require, but since I'm in the habit of dropping my extensions when calling include/require and love.filesystem.require expects a full filename, I put the following in top of my main.lua:
Works quite well
Code: Select all
function __require(modname)
for p in string.gmatch("?;?.lua", "[^;]+") do
local res, _ = pcall(function() love.filesystem.require(select(1, string.gsub(p, "\?", modname))); end);
if res then return true end
end
error("require() Could not locate include file '"..modname.."'");
end
Lua_require = require;
require = __require;
Sarcasm - just one of the services I offer.
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest