local text="If this shows, it did not work."
function love.load()
love.filesystem:setIdentity("TEST") --Right here! It says "main.lua:4: Calling 'setIdentity' on bad self. (string expected, got table)" "TEST" is a table I guess?
local h=love.filesystem:newFile("text.txt")
h:open("w")
h:write("If this shows, it worked")
h:close()
h:open("r")
text=h:read()
end
function love.draw()
love.graphics:print(text, 20, 20)
end
This is all the code. Again, here is the error. main.lua:4: Calling 'setIdentity' on bad self. (string expected, got table)
"your actions cause me to infer your ego is the size of three houses" -finley
You're calling it wrong. It should be love.filesystem.setIdentity(name). Note how it uses only periods, not colons. Colons, in Lua, mean something completely different. Likewise, don't use a colon for love.graphics.print().
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit! Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Just to help LuaWeaver better understand the difference.
This code calls the setIdentity function which lives in the filesystem table which in turn lives in the love table which is a global variable (meaning it lives in the globals table):
This code calls the setIdentity function the same way as described before, but adds the value in the left of the colon as an automatic first parameter to the call: