Stupid Questions About Coding Addons
Posted: Tue Aug 05, 2014 10:31 pm
So, I've been mucking around with coding addons lately, and the biggest problem has been the lack of documentation. I'm stumbling around, cribbing stuff from other addons and relying on trial-and-error to get things done.
So: I'm going to ask stupid questions about modding. Hopefully, someone answers them. I link the answer to the question in this post (for others to find), and I ask another stupid question.
Stupid Question Number One:
So I pretty much worked out that if I'm in load.lua, pinching a loadDefinition from another mod, the value it takes for loadDefinition needs to change from 'data-<theirmod>' to 'data-<mymod>'. This has solved pretty much all the problems I have with load.lua ... except for loadDefinition calls to PartyLore.
I've set the local/require call up for Partylore, called PartyLore in exactly the same way - except my calls get me this error:
Now, from my imperfect understanding of te4_log, that means load.lua tries to make the PartyLore call, and the engine tells it there's no such thing as PartyLore.
What am I missing?
EDIT: Okay, a little more reading done. Apparently, TE4 is getting to and trying to use
PartyLore.loadDefinition in class:bindHook("ToME:load", function(self, data)
before
local Partylore = require "mod.class.interface.PartyLore"
is run. And I have no idea how.
So: I'm going to ask stupid questions about modding. Hopefully, someone answers them. I link the answer to the question in this post (for others to find), and I ask another stupid question.
Stupid Question Number One:
So I pretty much worked out that if I'm in load.lua, pinching a loadDefinition from another mod, the value it takes for loadDefinition needs to change from 'data-<theirmod>' to 'data-<mymod>'. This has solved pretty much all the problems I have with load.lua ... except for loadDefinition calls to PartyLore.
I've set the local/require call up for Partylore, called PartyLore in exactly the same way - except my calls get me this error:
Code: Select all
Lua Error: /hooks/myamazingmod/load.lua:41: attempt to index global 'PartyLore' (a nil value)
At [C]:-1 __index
At /hooks/myamazingmod/load.lua:41
What am I missing?
EDIT: Okay, a little more reading done. Apparently, TE4 is getting to and trying to use
PartyLore.loadDefinition in class:bindHook("ToME:load", function(self, data)
before
local Partylore = require "mod.class.interface.PartyLore"
is run. And I have no idea how.