Code: Select all
function tUnit:new(t)
setmetatable(t, self)
I've extensively read about metatables and this is baffling in how irritating this is. tUnit has various functions defined and throughout tUnit:new(t) I use the self operator to initialize values. No matter what I do, t is continuously nil, and the meta table breaks. Any ideas? What am I doing wrong here?
Secondly, I am trying to set up a logging system and need to know how I can reopen a log that is already created and write to it. Do I just use love.filesystem.newFile with the same name? It works for the first line, but I don't know anything else because the tUnit class is breaking.