-
How does Wow link files together using the toc file and their own `require` syntax?
Wow Lua files can share a namespace with
Code:
local addonName, addonTable = ...
But when I load files manually and register functions, I can call the registered functions, but the shared addonTable is broken when the lua files are manually loaded instead of through the Addon folder. So I can't call functions from sibling scripts.
What functions in the client like FramescriptRegisterFunction and FramescriptRegisterTable can I look at to understand what goes on when the client load addons on reload and initially?
As of now I have to make everything standalone when doing lua stuff which is painful. I tried loading an xml file with the Script Includes, but that didn't work.
-
Contributor
Originally Posted by
GlittPrizes
Wow Lua files can share a namespace with
Code:
local addonName, addonTable = ...
But when I load files manually and register functions, I can call the registered functions, but the shared addonTable is broken when the lua files are manually loaded instead of through the Addon folder. So I can't call functions from sibling scripts.
What functions in the client like FramescriptRegisterFunction and FramescriptRegisterTable can I look at to understand what goes on when the client load addons on reload and initially?
As of now I have to make everything standalone when doing lua stuff which is painful. I tried loading an xml file with the Script Includes, but that didn't work.
Programming in Lua : 8 loadstring() loadfile()
-
Post Thanks / Like - 1 Thanks
GlittPrizes (1 members gave Thanks to ChrisIsMe for this useful post)
-
Originally Posted by
ChrisIsMe
The issue now is that addon becomes tainted for the part that is put in Interface/Addons/ and I'm not sure how write to 0 for an already loaded addon. I also didn't realized I could declare global/shared variables by just not using the local keyword which will work for my purposes, so I reverted to manual loading.
edit: shit I uploaded the wrong gif can a mod plz remove the revealing one?
Last edited by GlittPrizes; 11-08-2020 at 11:52 AM.
Reason: THE HAMMER