Hey guys,
I recently encountered a bit of an inconsistency with trying to use asset libraries.
When using the orthographic library the following works fine in lua:
__dex_lib_orthographic_Camera = _G.require("orthographic.camera")
However when using the Monarch library, the following does not work:
__warbattles_monarch_Monarch = _G.require("monarch.monarch")
/main.lua:67: module 'monarch.monarch' not found
However it works if I change it to this:
__warbattles_monarch_Monarch = require("monarch.monarch")
So what exactly is the deal with _G
? And why is it different for these two libraries? From what I can tell on Github they both have the same structure…
local M = {}
...
return M