local sti = require "sti"
function love.load()
mapa = sti(teste.lua)
end
function love.update(dt)
mapa:update(dt)
end
function love.draw()
mapa:draw()
end
Does anybody know what is happening here?
Last edited by mitzi65 on Fri Jan 06, 2017 2:45 pm, edited 1 time in total.
Did you download STI and put it into your project folder? It's not something that comes with löve itself.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Yep,I did. The STI folder is on the same folder as main.lua. I noticed something weird about my problem too, the require function is not working when I am using it without Löve too (just as pure lua code). Could therebr a problem with my environment variables since I am using a chromebook with linux (using crouton for chroot)? (Maybe this problem should be made in a lua forum instead of a Löve one?)
You need to do:
local sti = require "sti/sti"
since the sti lua file is in the sti folder.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
zorg wrote:
since the sti lua file is in the sti folder.
But why? You can have an "init.lua" file in your module folder and calling "require ( modulefolder )" will call this file.
don't ask me :V
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
raidho36 wrote:
But why? You can have an "init.lua" file in your module folder and calling "require ( modulefolder )" will call this file.
That's Lua's fault. The implementation of `init.lua` isn't complete. It works when the library is in certain places (like when installed by LuaRocks) but not when you are trying to use a local package. This happens consistenly in Lua 5.1, 5.2, 5.3 and LuaJIT, so I don't know whether I am getting crazy or there is some reason I don't understand.
raidho36 wrote:
But why? You can have an "init.lua" file in your module folder and calling "require ( modulefolder )" will call this file.
That's Lua's fault. The implementation of `init.lua` isn't complete. It works when the library is in certain places (like when installed by LuaRocks) but not when you are trying to use a local package. This happens consistenly in Lua 5.1, 5.2, 5.3 and LuaJIT, so I don't know whether I am getting crazy or there is some reason I don't understand.
Are you running Debian? I had the impression this was something weird the Debian package maintainers did, and it didn't affect other platforms. I'm not sure it's Lua's fault; as far as I know they don't make any recommendation for what exactly should go in package.path (from LUA_PATH or luaconf.h), so it's just up to package maintainers to do something sensible.
It's weird that it happens in Love, though, because Love only uses the built-in loader (and package.path) as a fallback for its own loaders, which I thought fully supported the init.lua thing.