Excellent, this worked and is in fact a much more full solution than I need -> I will only be creating one instance of game_wrapper and I am only calling functions in the game object, not retrieving data. I tried a solution similar to the one you gave with no luck. The innovation that I wasn't aware was possible//didn't think of was to pass back a function block with a parameter structure already built in, very clever. You have my thanks.
local game_wrapper = {}
local game_wrapper_mt = {}
function game_wrapper_mt:__index(key)
local proto = rawget(self, "__proto__")
local field = proto and proto[key]
if type(field) ~= "function" then
return field
else
return function (obj, ...)
if obj == self then
return field(proto, ...)
else
return field(obj, ...)
end
end
end
function game_wrapper:new()
return setmetatable({__proto__ = game}, game_wrapper_mt)
end
my_game = game_wrapper:new()
my_game:out("This text should appear in the debug console like as if I'd called game:out()!")