Page 1 of 1

Resourcces to help fledging addon makers?

Posted: Sun Oct 22, 2017 12:50 pm
by Osmodius
G'day, I've had a bit of a hankering to play around making addons.

I've made minor changes before, but I'm wanting to do more.

For the most part it's pretty easy to open up the currently existing classes and addons that already work, and cannibalise/learn from them.

But there's some things that don't quite make sense (for example one ability has "local hit = self:attackTarget(target, nil, t.getDamage(self, t), true)", I can work out what most of it means, but I don't know what the nil refers to).

Is there a comprehensive list of how things work and what each command does? There's the reference for modules, is everything that I need to know about in there, and I'm just not looking hard enough? Or is there another list somewhere?

I've managed to get a single skill tree working so far! There's just some things that are a bit confusing or I've had to give up on slightly to move forward.

Re: Resourcces to help fledging addon makers?

Posted: Sun Oct 22, 2017 5:33 pm
by astralInferno
There is no comprehensive list of anything, as far as I'm aware. Everything in lua is cobbled together.

(In the case of your example, you would find the definition of attackTarget in mod/class/interface/combat.lua. "nil" here is being passed as the damage type of the attack: attackTarget sees you gave it no damage type, so the attack uses whatever damage type your attack would normally do - so, usually, physical.)

People are usually willing to help explain, though - I did all my stuff by cannibalising other addons and asking for help on IRC. I still barely know what I'm doing, but things do eventually start to make a bit of sense. One important revelation I had is that tome/lua doesn't have any central definitions. I used to assume that somewhere there was a guideline for talent creation; something that would look for a talent's cooldown, range, etc. There is no such thing, though. The building blocks of a talent are relevant only because other things look for them. Everything in lua only exists when something else looks for it.

I hope some of this helps.

Re: Resourcces to help fledging addon makers?

Posted: Sun Oct 22, 2017 11:54 pm
by Osmodius
astralInferno wrote:There is no comprehensive list of anything, as far as I'm aware. Everything in lua is cobbled together.

(In the case of your example, you would find the definition of attackTarget in mod/class/interface/combat.lua. "nil" here is being passed as the damage type of the attack: attackTarget sees you gave it no damage type, so the attack uses whatever damage type your attack would normally do - so, usually, physical.)

People are usually willing to help explain, though - I did all my stuff by cannibalising other addons and asking for help on IRC. I still barely know what I'm doing, but things do eventually start to make a bit of sense. One important revelation I had is that tome/lua doesn't have any central definitions. I used to assume that somewhere there was a guideline for talent creation; something that would look for a talent's cooldown, range, etc. There is no such thing, though. The building blocks of a talent are relevant only because other things look for them. Everything in lua only exists when something else looks for it.

I hope some of this helps.
I had a strange feeling that was going to be the answer!

I'll just keep sifting through things and see what I can scrape together aha. Looking through the Combat.lua does clear up some things though, might have to look through the rest at some point and see what other little things pop out.

Re: Resourcces to help fledging addon makers?

Posted: Mon Oct 23, 2017 7:49 am
by Razakai
Actor.lua and Combat.lua contain a lot of the most common and important functions that talents will call. I'd recommend getting some sort of tool for searching the codebase so you can find the definitions of things like your attacktarget.

Re: Resourcces to help fledging addon makers?

Posted: Mon Oct 23, 2017 9:03 am
by Osmodius
Razakai wrote:Actor.lua and Combat.lua contain a lot of the most common and important functions that talents will call. I'd recommend getting some sort of tool for searching the codebase so you can find the definitions of things like your attacktarget.
Yeah, that's about close enough to what I need to understand! Now it's just a matter of sifting through and remembering it without having to dive back in every 30 seconds.