Code: Select all
function pretty(thing)
if type(thing) == 'table' and thing.factorio_class then
return '[Factorio: ' .. thing.factorio_class .. ']'
else
...
end
end
print(pretty(game))
(output: [Factorio: LuaGameScript])
This would be especially helpful for people tackling the initial learning curve of mod design like myself, as we are the ones who are most prone to get mixed up and lose the What The Heck Have I Got a Handle For Here? game.