Load a Lua script into a table named after filename
- by Homeliss
I load scripts using luaL_loadfile and then lua_pcall from my game, and was wondering if instead of loading them into the global table, I could load them into a table named after their filename?
For example:
I have I file called "Foo.lua", which contains this:
function DoSomething()
--something
end
After loading it I want to be able to access it like:
Foo.DoSomething()
Thanks!