Quantcast Trying to Learn - WoWInterface
Thread Tools Display Modes
06-16-19, 05:31 PM   #1
Aeriez
A Fallenroot Satyr
Join Date: May 2007
Posts: 24
Trying to Learn

Are there any up-to-date resources to learn Lua in conjunction with WoW? I've found one series on YT regarding it but it's severely out-dated and the individual appears to have stopped making them right in the middle. Generic documentation doesn't help much in that regard. Unfortunately, Lua seems to be an incredibly sloppily written language so migrating from a C++ and PHP background isn't exactly a smooth transition lol.

Last edited by Aeriez : 06-16-19 at 06:00 PM.
  Reply With Quote
06-16-19, 08:19 PM   #2
Kanegasi
A Scalebane Royal Guard
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 409
Lua itself is not sloppy. Its a simplistic language. WoWs API, however, is pretty crazy. It has definitely gotten better over the years and the last two expansions someone on the Dev team has been super busy organizing things.
  Reply With Quote
06-16-19, 09:34 PM   #3
bsmorgan
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 181
I also have to disagree with you about Lua being "incredibly sloppily written".

http://www.lua.org/ and http://lua-users.org/ are two sites that are good resources for Lua. There are a couple of (dated) books available that target writing addons for WoW. There are some good WoW API reference sites like https://wow.gamepedia.com/Wowpedia:I..._customization and https://wowwiki.fandom.com/wiki/World_of_Warcraft_API that are pretty much up-to-date.
  Reply With Quote
06-16-19, 11:42 PM   #4
MooreaTv
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 31
saying lua is sloppy in the same sentence as php is... well... sloppy to say the least

but languages wars aside, it's all about the actual code and not the language
  Reply With Quote
06-17-19, 03:58 AM   #5
FranekW
An Aku'mai Servant
 
FranekW's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 35
I would recommend reading this if you are interested in building your first addon:
https://www.wowace.com/projects/ace3...etting-started

It explains a simple process which is based on Ace3. If you don't like the idea of using libraries, you might need to find some other resources. Here on Wowhead, at the bottom of the page, there are some useful links including tutorials on lua. GL.
  Reply With Quote
06-17-19, 06:05 AM   #6
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 166
Ask

The best resource I found for learning and understanding Lua is asking questions.

The community here is pretty awesome.
They helped me a lot while writing my first (and and second amd third and ...) addon.
__________________
Better to fail then never have tried at all.
  Reply With Quote
06-27-19, 10:00 PM   #7
Aeriez
A Fallenroot Satyr
Join Date: May 2007
Posts: 24
Definitely have asked a few questions. Haven't gotten any responses yet. I'm going to assume that's because this forum is dead as I'm sure it's not because no one has a clue how to answer. What I meant by sloppy is there is absolutely no documentation or resources what-so-ever on the internet. You've got wowwiki with a lot of the API stuff, but it covers (seemingly) less than 1/10th of what there is in the API. Framestack is completely useless and doesn't give any information. It just seems like in order to learn Lua in WoW you have to datamine all of the information yourself. Which is just a bit mind blowing considering the popularity of the game. No one has written any tutorials on learning it? Really? Someone make one. You'll be filthy rich. lol.

As far as learning lua from lua.org, that's not really going to work. I understand the syntax of it already. It's the elements and WoW specific functions that I'm trying to learn. Which is seemingly a well-kept secret. How do you create HybridScrollFrames? No clue. There's no possible way to learn it. How do you hook into a specific frame that already exists in the WoW client? Not a clue, framestack just gives a random string of characters, not the actual name of the element. Been trying like hell for the last 3 weeks to learn. But the content to learn from is virtually non existent. Quite frustrating. Excuse the rant. I just hate running in circles to be told "look at the stuff you've already looked at that gives absolutely no information".

Last edited by Aeriez : 06-27-19 at 10:05 PM.
  Reply With Quote
06-27-19, 10:53 PM   #8
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,134
There have been several books written on creating addons for WoW (I don't think anyone got rich from them) and much of the basic information in them is still relevant although somewhat geared toward XML (also still viable).

gamepedia is probably the better resource for up-to-date API information.

FrameStack is a useful tool (even more so these days with FrameStackGlobalizer because stuff happens)

I haven't seen any questions so I'm not sure where you asked unless they've been generic "show me how to make an addon" type questions. Specific "Tried/trying to do this and got these errors/funcky results" with some code tend garner more responses because the possibilites of things you can do in wow are huge and general questions tend to require book size responses.

Just because it's a game many assume that addon creation is a simple prospect. Apart from other addons, one of the <cough>basic learning tools/sources of information is the Blizzard UI itself. You can extract all the UI code that makes up the stock UI and "see how Blizzard does it".

Blizzard is also documenting parts of the API see /api in-game (it's better with this)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
06-27-19, 11:34 PM   #9
Aeriez
A Fallenroot Satyr
Join Date: May 2007
Posts: 24
So where's the API information on HybridScrollFrame_CreateButtons. Or the documentation on how it interacts with HybridScrollFrame_Update? You can't just read Blizzards code itself and draw that conclusion. There's absolutely no markup in their scripts what-so-ever identifying what is doing what. HybridScrollFrame appears to be the (nearly) only real way to display information in a spreadsheet format in a UI. But there's absolutely no documentation anywhere on the web on how to make them. That just seems very odd to me. If I wanted to write a basic rollover script in javascript, a google search on how to do so would yield hundreds of thousands of examples how. If you want to learn how to make a frame that returns values in spreadsheet format (like for a dkp addon etc) in WoW, you're kinda SOL, because no ones telling you how. lol. I've taken addons using it and tried to pick it apart, but they've got entirely too much crap going on at once and use variables like "a1" or "f3" which isn't descriptive enough to actually make anything of it. Someone made a FauxScrollFrame tut here which was very helpful. But from what I've learned, fauxScrollFrame is mostly deprecated in favor of hybrid. Which is written completely different from the Faux template from what I can tell.

Last edited by Aeriez : 06-28-19 at 12:06 AM.
  Reply With Quote
06-28-19, 12:30 AM   #10
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,134
HybridScrollFrame is probably not that often used and unlike JavaScript there are a lot less WoW addon authors to find people with time and inclination to write up documentation/examples on every aspect.

Once again, you're being very generic using the term "spreadsheet" as your starting point because not being a business data based application, spreadsheets aren't really a WoW thing and automatically bring to mind that you want to re-create Excel in WoW so, not likely to happen unless you write it from scratch yourself.

At least start with one or more of the addon names that you looked at and some idea of the functionality from it/them you want to replicate.

Edit: fauxScrollFrame is fine (great for straight forward lists) and not "deprecated" (Blizzard still use it in at least 18 places). If it suits your needs, use it.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 06-28-19 at 12:37 AM.
  Reply With Quote
06-28-19, 12:32 AM   #11
Lybrial
A Theradrim Guardian
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 66
I started coding WOW AddOns myself only a couple of weeks ago so maybe it is worth it when
I give you my opinion on that.

First: Im a senior software engineer in real life running my own software company, so Im
pretty experienced in that area. I can tell you: The language does not matter. The
language is just a Tool. Lua maybe does not seem to be the best language in the world
but it does not need to be. Every language has its advantages and disadvantages. Also
the lua language itself is very well documented, so you wont get any problem with lua.

Second: A little bit different is it when it gets down to the WOW API. I agree... the
documentation of the WOW API is horrible compared to how documentations usually
look like. Personally I would never release an API so badly documented like the WOW
API is, especially not when Im a company as big as Blizzard.

So what we all need is the WOW community. But if you think of it, there arent that many
people on the world who are interested in coding stuff for WOW. That is why you wont find
many resources of examples on how to do specific things with the WOW API. You will
find basic stuff for sure though.

What I liked to do was to download AddOns of other developers and look into their code
to see how they solved problems. Since this is mostly undocumented / without comments
its sometimes hard to understand but if you dive into it and give it some time you will
understand it, adapt it and find your own solutions.

Otherwise I can recommend to ask ask ask ask. Just yesterday I was on the WeakAuras
Discord and I asked a question to solve a specific thing with lua in WeakAuras. They
explained it to me and they had a really hard time with me because It took me very
long to understand what they were telling me. They let me know that they were quite
annoyed that I did not understand very quickly but after some chatting they were able
to provide a simple and easy to understand example. Ofcourse you need to stay friendly

Btw here at wowinterface I already got a lot of qualified answers to my questions which
were helping me alot.

So... It is not easy to come up with something great when you just began with WOW coding.
But with the time comes the skill and the fun!
  Reply With Quote
06-28-19, 04:22 AM   #12
LanceDH
A Cyclonian
 
LanceDH's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 41
Originally Posted by Aeriez View Post
So where's the API information on HybridScrollFrame_CreateButtons. Or the documentation on how it interacts with HybridScrollFrame_Update? You can't just read Blizzards code itself and draw that conclusion.
I just wanted to chime in and say that this is exactly how I learned to use HybridScrollFrames.

I could be wrong in this assumption, but I seem to be in the minority when it comes to using XML for their add-ons. Which means the best way for me to learn is to dig through Blizzard's UI code for examples. It's also how I recently learned to create Cooldowns like the ones for work orders.

As for a guide, I can only speak for myself. I dislike writing long texts. I'm ok at it, but it takes ages, and I generally don't have to free time that I'm willing to spend on it.
  Reply With Quote
06-28-19, 10:05 AM   #13
Aeriez
A Fallenroot Satyr
Join Date: May 2007
Posts: 24
Originally Posted by Lybrial View Post
I agree... the
documentation of the WOW API is horrible compared to how documentations usually
look like. Personally I would never release an API so badly documented like the WOW
API is, especially not when Im a company as big as Blizzard.
I think this is my biggest frustration with trying to learn WoW specific functionality of Lua. It requires far more digging than I'm used to. Between examples of functionality and documentation, I'm pretty good at playing around with it until it starts doing what I want it to do. And at that point it just clicks "Oh so that's how that works" sort of thing. It seems like when I want to learn how a specific function works, it just leads to another function that I need to figure out that is within it. Which leads to yet another 3 functions you need to figure out. And sometimes it seems like you never really find the bottom of the nesting pool.
  Reply With Quote
06-28-19, 10:12 AM   #14
Lybrial
A Theradrim Guardian
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 66
Originally Posted by Aeriez View Post
I think this is my biggest frustration with trying to learn WoW specific functionality of Lua. It requires far more digging than I'm used to. Between examples of functionality and documentation, I'm pretty good at playing around with it until it starts doing what I want it to do. And at that point it just clicks "Oh so that's how that works" sort of thing. It seems like when I want to learn how a specific function works, it just leads to another function that I need to figure out that is within it. Which leads to yet another 3 functions you need to figure out. And sometimes it seems like you never really find the bottom of the nesting pool.
Exactly. And since we are all just devs which are doing this for fun in our freetime while having a fulltime job
we also dont have the time to create a webpage with a good documentation and good examples
  Reply With Quote
06-28-19, 11:15 AM   #15
bsmorgan
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 181
Originally Posted by Lybrial View Post
Personally I would never release an API so badly documented like the WOW
API is, especially not when I'm a company as big as Blizzard.
Blizzard created this API for the purpose of writing their own UI. I'm guessing they have documentation for internal use. They could have kept the API private and user-written addons would not have been possible.

Instead, they made the decision to allow user-written addons with the caveat that the API was not guaranteed to remain stable, was provided as-is with no documentation, and could/would be changed at anytime at their discretion including changes to cripple addons they determined to be unacceptable.

Over time, Blizzard has demonstrated the instability of the API with deletions, incompatible changes, and numerous other challenges for the addon community to figure out on our own. In some cases, they did listen to the addon community and modified the API to allow controlled access to sensitive areas.

In summary, Blizzard's API is primarily for their internal use. The fact that we can also use it is a bonus, a privilege, not a right.
  Reply With Quote
06-28-19, 12:25 PM   #16
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,668
Originally Posted by bsmorgan View Post
In summary, Blizzard's API is primarily for their internal use. The fact that we can also use it is a bonus, a privilege, not a right.
This. And, as Fizzlemizz pointed out, they have been making an effort lately to do some documentation for addon authors. But it's not top priority.



Also... http://www.catb.org/~esr/faqs/smart-questions.html
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
06-28-19, 01:33 PM   #17
Lybrial
A Theradrim Guardian
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 66
Yeah, dont get me wrong. I know that Blizzards API is a benefit for us and that it is
not taken for granted. But still my point is that I would not release it in that way.
Writing a good documentation is not hard, in most cases this can be done automated
nowadays.

But I really like the idea of a community handeling all this stuff. If more people
would take care of it we would already have a documentation and maybe also a
good code base full of examples. But thats easier said than done because as already
mentioned, we are all doing that for fun and have something else to do in RL.

Gladly there are already some really good Frameworks to begin with. Ace for example.
I love it.
  Reply With Quote
06-28-19, 01:56 PM   #18
LanceDH
A Cyclonian
 
LanceDH's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 41
Originally Posted by bsmorgan View Post
Blizzard created this API for the purpose of writing their own UI. I'm guessing they have documentation for internal use.
About that...
This is from 4 years ago of course. Considering the 7.2 documentation, it's probably getting better now.
  Reply With Quote
06-28-19, 02:15 PM   #19
Ketho
A Molten Giant
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 883
Let me quote foxlit on that



Nobody wants to write API docs anymore
  Reply With Quote
06-28-19, 04:25 PM   #20
bsmorgan
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 181
Originally Posted by Ketho View Post
Nobody wants to write API docs anymore
Nobody wants to write ANY documentation anymore. When was the last time you bought something that had more than a few pages of documentation (in your language)?

And don't tell me a picture (video) is worth 10,000 words . Often Youtube is the best documentation you are going to find.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Trying to Learn

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off