Original Post
Here's a simplified version of turretManager.lua: I use tManager from another lua file in the same Lua state: I get a lua error when I try to use tManager:someMethod(), saying that I'm attempting to concat the field self.mNumTurrets, which is a nul value. WHAT GIVES?! I'm going crazy here. This is exactly according to the Lua tutorials... Or is it? [Edited by - Bagheera on August 17, 2007 11:43:53 AM]
turretManager = {}
turretManager.__index = turretManager
function turretManager:new()
local mgr = {}
setmetatable(mgr, turretManager)
mgr.mNumTurrets = 5
return mgr
end
function turretManager:someMethod()
print(self.mNumTurrets .. "hi")
end
tManager = turretManager.new()
dofile("TurretManager.lua")
tManager:someMethod()