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.
|
Lua itself is not sloppy. It’s a simplistic language. WoW’s 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.
|
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. |
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 |
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. |
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. |
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". |
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) |
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.
|
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. |
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! |
Quote:
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. |
Quote:
|
Quote:
we also dont have the time to create a webpage with a good documentation and good examples :) |
Quote:
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. |
Quote:
Also... http://www.catb.org/~esr/faqs/smart-questions.html |
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. |
Quote:
This is from 4 years ago of course. Considering the 7.2 documentation, it's probably getting better now. |
Let me quote foxlit on that
Nobody wants to write API docs anymore |
Quote:
And don't tell me a picture (video) is worth 10,000 words ;) . Often Youtube is the best documentation you are going to find. |
All times are GMT -6. The time now is 08:29 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI