1. #1

    New to .LUA - Just a question

    Hello, im looking at learning how to code .lua so I could make my own addons. I was just curious, as a noob to coding, which area of the game would maybe be easiest to try and make an addon for? Would the chat, minimap, quest log, etc. be a good place to start/learn?

    I've looked at Olisons thread with the tutorials and guides, helpful stuff, though are all those links up to date or is there a site not listed there thats great for idiots like myself?

  2. #2
    I learned lua by looking at other people's addons.
    Grid had this great plugin called GridStatusPriestAoe, but I wanted to adapt it to use in ElvUI.
    I used plugins that were already written for ElvUI as a template (a huge help to starting out) to get started then I just ported the functions over.

    Some of the learning is a clever use of google looking for the correct wow API or pouring over code in the addons in your folder. Want to know how to make an icon frame, look at another addon that does it. Want to make a menu, look at another addon.

    I could also suggest to start in WeakAuras. Make a custom weakaura that does something cool.
    Some of the custom weakauras I've made.

    1) Sha of Pride pride tracker table for everyone in the raid before BigWigs/DBM implemented it in an altpower table. It also turns the names a color depending on how much pride you have
    http://pastebin.com/ga4yaXX2

    2) Heroic Paragons dynamic kill list. Current target green on list, dead targets red, targets not yet dead white.
    http://pastebin.com/bqbT4byK

    3) Arms warrior rotation through a single weakaura button
    http://pastebin.com/Wai6GMib

    If you have a small need for something niche, make a custom weakaura. It's really powerful.
    Just remember, there are lots of wow API and lua functions. It doesn't hurt to read the lua website to find out how all this works.
    I remember one of the weirdest things I learned is that when you have a table (local foo = {'test'}) and even when you copy that table to another variable (local foo2 = foo); if you modify the table foo2, you then just modified the original table. You have to make a copy of the table by looping through it.

    So yeah, just start reading!

  3. #3
    Lua is a real programming language, used beyond the scope of WoW, and there are a bunch of books out there aimed at helping people learn the language itself. You can also find other learning resources on the lua.org site I linked, or by googling for lua tutorials.

    IMO, the best place to start, though, would be WeakAuras or TellMeWhen. Both of those provide a rich framework for doing a limited set of things in the game, and both allow you to use small bits of custom lua code inside their framework. Figure out a problem that can be solved with them, and apply small amounts of lua to solving it.

    Then step up and start doing bigger things, later. Those two limit the amount you have to know about lua and wow programming in general, which makes it easier to focus on the things you want to do. Once you have that mastered you can totally step out into broader programming tasks inside the game.

  4. #4

  5. #5

  6. #6
    One last thought. You might find the ace addon framework API documentation valuable to read. If you do build something I suggest you make it ace based. Not so much because ace is always the right answer but rather because it hides much of the ugly stuff in wow programming from you while you are still learning it all. Plus it gives reasonable structure to your work for you.
    Last edited by SlippyCheeze; 2014-02-07 at 06:35 PM. Reason: tyops

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •