Stupid Questions About Coding Addons

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
fireflutterpony
Low Yeek
Posts: 8
Joined: Wed Feb 20, 2013 7:08 am

Stupid Questions About Coding Addons

#1 Post by fireflutterpony »

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:

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
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.

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Stupid Questions About Coding Addons

#2 Post by HousePet »

Capital L.
My feedback meter decays into coding. Give me feedback and I make mods.

fireflutterpony
Low Yeek
Posts: 8
Joined: Wed Feb 20, 2013 7:08 am

Re: Stupid Questions About Coding Addons

#3 Post by fireflutterpony »

...

Yeah, that would help.

Thanks!

Post Reply