I took a look at the forums, and searched a couple terms and came up with nothing regarding writing mods.
My guild could really benefit from someone writing mods for new encounters we learn.
The question I have is how much experience with other programming languages (ie C, Java, Html, etc.) do you need to be understand and use the lua programming language.
I looked through a couple of introductry websites and gathered a small amount of information, seemed like you needed a fair amount of experience with xml and basic experience with programming.
Any hints or tips would be great on how to get started or recommended prerequistes before actually writing mods for WoW.
I have taken a college course in introductory C programming and also MATLAB for engineering applications, I believe these will be enough to satisfy the procedural portion of your suggestion.
The XML on the other hand may prove to be difficult for me, is XML similiar to HTML?, because I do have some experience regarding HTML.
Fatkul! Fill in your profile! Anyway Drakul and I are from the same guild, and learning how to write mods to have a modwriter in guild would be seriously helpful for new encounters, and not always having to rely on mods others create which may not be what we really need for a particular encounter.
I know a lot of guilds have mod writers in guild, hopefully Drakul can learn how!
-Cerralius
60 Mage, Shattered Hand
http://ctprofiles.net/7009
I've been poking around a bit, and it looks like wowace is the easiest way to get started. Your other option is to pick a relatively simple mod and deconstruct it and pick up on LUA that way. The worst part of LUA for me (Java/C/C++ programmer) is it's typelessness, I like knowing what a variable is supposed to hold.
On a side note, who else thought of the thread title as "Best Practices: Writing Mods?" =/
DeeNogger: "No dot timer? Get your belt off, its spanking time."
So basically variables a re not defined as floats / decimals/ etc , Just a universal variable type?
It also seems the once you establish your own framework that the programming seems as simple as defining if statements in functions like, Anub'rekan casts locust swarm then do this.
As far as I'm aware (bear in mind I haven't written anything myself, and besides this machine doesn't have any LUA to check with) all you can define with a variable is it's scope (local/global), after that it can hold anything (akin to a pointer in C or an Object in Java).
DeeNogger: "No dot timer? Get your belt off, its spanking time."
My guild could really benefit from someone writing mods for new encounters we learn.
I highly recommend taking a look at Bigwigs, and just dissecting what it does based on your needs. It should be pretty easy to infer what you need to.
The question I have is how much experience with other programming languages (ie C, Java, Html, etc.) do you need to be understand and use the lua programming language.
C/++ are like Latin. If you know Latin backwards and forwards, it's ridiculously easy to read dozens of languages. However, at some point, you need to actually start speaking it, and then the vocabulary has its own shift. Little nuances get moved around.
HTML is not a programming language, but a MARKUP Language - it doesn't DO, it DESCRIBES. Just a nitpick.
XML is a more strict relative of HTML - think about this. The < P > aragraph tag must be closed, but every browser everywhere will just automatically close it anyway. XML doesn't let you ever take shortcuts like that.
I looked through a couple of introductry websites and gathered a small amount of information, seemed like you needed a fair amount of experience with xml and basic experience with programming.
Any hints or tips would be great on how to get started or recommended prerequistes before actually writing mods for WoW.
If you want to make well crafted, well engineered, properly designed code in any language, it's going to be a long, tough road and you should start by exhausting the introductory texts on that language ( http://www.lua.org - reading the specification is a fine start ).
If you want to get a mod working by this Friday, start reading bigwigs, figure out what translates to what... make tweaks, see what happens...
Everybody is your brother until the rent comes due.
The way BigWigs is written, it's modular. You can just as easily add a new script to be loaded with the existing scripts, which means you don't have to start from scratch. Most boss fights have similar timing mechanisms like "fear every 15 seconds" or "on cast announce xx spell" type stuff. Just rip apart a previous module for an existing boss and go for it. Timing systems, bars, raid announce, all of it, can just be dropped in based off of a previous script.
You should very quickly figure out how to do what I'm talking about, the folders are separated on a "by instance" basis. Also, there a number of "extra scripts" out there which attach onto the existing boss mods and add more functionality for a specific encounter to take examples from. The people who frequent the Ace community are also very helpful. It can all be found at the Ace forums: http://www.wowace.com/forums/index.php?board=25.0
Why on earth do you need to start writing custom mods for your raid? You are not fighting bosses no one else in WoW is fighting (if you are, let us know how!). BigWigs or La Vendetta has pretty good boss timings at this point with all those weird caveats bosses have, theres no reason to reinvent the wheel.
But yeah ace2 is a great framework for writing mods, that plus stuff like TekWatch help with memory leak debugging. There are also some variable monitors you can get, you can get all the dev help at www.wowace.com.
I don't see the point in using a framework or some other buzzword compliant word. Rarely needed and making it on your own is much better for really understanding how it works.
LUA isn't really hard, it just has its quirks. It's very stringent on nil. If you know C or similar it's not that hard. Only really annoyance I have is that constructs like:
doesn't quite do what you think, juts looking at the code. In normal languages it checks if somevariable is logically true, in lua it checks if it's nil or not. So in my example above DoOneThing(); would always be executed.
All in all, lua is quite nice. It's not divine like perl but it does the job (oh, how I'm gonna get flamed for that).
Originally Posted by Dakous
XML is a more strict relative of HTML - think about this. The < P > aragraph tag must be closed, but every browser everywhere will just automatically close it anyway. XML doesn't let you ever take shortcuts like that.
Totally nitpicking, but according to W3C for HTML 4.01 transitional about the Paragraph tag:
I don't see the point in using a framework or some other buzzword compliant word. Rarely needed and making it on your own is much better for really understanding how it works.
LUA isn't really hard, it just has its quirks. It's very stringent on nil. If you know C or similar it's not that hard. Only really annoyance I have is that constructs like:
doesn't quite do what you think, juts looking at the code. In normal languages it checks if somevariable is logically true, in lua it checks if it's nil or not. So in my example above DoOneThing(); would always be executed.
Not only wouldn't the code do what you'd think, it wouldn't work as it's not valid lua...
local somevariable = 0
if (somevariable) then
DoOneThing()
else
DoAnotherThing()
end
Also, to nitpick a bit, semicolons at the end of a line is optional in lua, and parenthesis in if statements are optional as well, so:
local somevariable = 0
if somevariable then
DoOneThing()
else
DoAnotherThing
end
To get back to the original question, lua-users.org/wiki/TutorialDirectory is a pretty good starting-place to learn lua.
Personally I found that skipping the whole XML-bit and simply creating everything dynamically is a lot easier to do. Not because the XML-bit is *hard* per se (I use XML *extensively* at work, so have quite a lot of experience with it), but simply because it's a whole lot easier to tinker with code directly in the game than keep doing changes in the XML and reloading the UI.
I would also *highly* recommend getting LuaSlinger for playing around with lua in-game.
LUA isn't particular hard if you've used any other language before. The hard thing I would say is getting to know the WoW API and the way the WoW interface works. You're dealing with a real time game, and that requires some rethinking if you come from fairly static enviroments like shell and server scripts.
If you are familiar with C there are all kinds of lua libs that allow you to write lua code in your IDE of choice. If you use visual studio just search for "studio lua" and you will find a handful to download. Just pick one you want. In the end these are very nice because they allow you to step through code in a debugger and you can write and test all of your code which does not interface with the UI API with the help of a debugger. As far as XML goes I think any programmer can make the XML stuff work just by hacking apart existing addons. If you are comfortable with C and not XML I would say just jump right in. If you are not familiar with either then there will be more work involved.
Also one of the main differences between lua and compiled code is that name collisions are never resolved.
For example, I was using /bb to access slash commands in a mod and some people in the guild had some other mod using that same thing and it looks like whoever registers it first wins.
Also make sure that your function names are similarly unique. Having a decent but generically named function like toggleButtonState() is very dangerous because if another addon has this function name you will overwrite their definition or they will overwrite yours. The functions are not at all module specific. Just think of every single function of every addon being thrown into a giant tub, there is no separation at all. You need to have very specific names to protect your code so preface everything with a unique identifier.
As far as naming collisions go, you're better off naming your non-local functions and variables with some portion of your mod's name, such as:
function MyMod_OnLoad()
That will keep everything clean and organized and prevent collisions.
Slash commands are a tossup, because there's a tradeoff between short commands and chance for collision. I usually provide short commands for my own use, but expend them to long ones if I publish something.
Need a Mumble server? I run MMO-Mumble for all your voice chat needs. | My rogue planning tool: Shadowcraft
1. Intro to C is fine, the more comfortable you are with programming the better.
2. If you don't want to do graphical mods, you do not need much XML stuff, I've been using the same XML for my boss Mod since I finished my first boss mod basically.
3. www.wowwiki.com is your primary source of knowledge.
4. What I often do is take an existing mod (like BigWigs) and have mine work off of that. I either steal code, or I run BigWigs during an encounter and have it call functions of my mod, or have my mod pick up calls from BigWigs.
IE: on 4H I have it so BigWigs sends me a tell every time the 4H mark. I interpret that tell with my mod and have some logic built in that will shout out commands in /rw, as well as shoot tells to certain people.
doesn't quite do what you think, juts looking at the code. In normal languages it checks if somevariable is logically true, in lua it checks if it's nil or not. So in my example above DoOneThing(); would always be executed.
Personally, I find lua's evaluation of "0" as "true" quite handy. When you have a vaue that may be nil or numeric, and you want to check if the value exists, I much prefer:
if value
to:
if value or value == 0
Ruby's the same way, FWIW.
Need a Mumble server? I run MMO-Mumble for all your voice chat needs. | My rogue planning tool: Shadowcraft
The question I have is how much experience with other programming languages (ie C, Java, Html, etc.) do you need to be understand and use the lua programming language.
If you have any experience with scripting languages (perl, javascript), lua is extremely easy to pick up and work with.
I want to emphasize what someone else said earlier about global scope being the default, since that was an early mistake for me that took forever to debug. Naming functions/frames with your mod's name is good practice or else you'll run into weird issues with other mods. You can also take a look at lua's OO documentation (http://lua-users.org/wiki/ObjectOrientationTutorial) to handle that in a bit cleaner fashion (which happens to be what Ace2 mods use).
You also don't NEED to know XML, since you can create frames dynamically without ever needing a .xml file (again, look at Ace2). IMO, though, unless you're just making simple boss mods or combat parsers, which don't really have GUIs, creating the XML file can help understand how WoW handles frames (frameStrata and other such things).
If it helps, Blizzard provides an Addon kit at http://www.blizzard.com/support/wow/?id=aww01671p. It's not much, but it provides a little tutorial for creating a really simple mod, and it also has all of the lua/xml code for the default WoW UI, if you ever wanted to see how it works.
Is there a mod out there that is designed to script new encounters while in game?
Usually, there are plenty of options for mods on encounters. When there wasn't a mod available, we have gotten by without it either through people paying more attention, running timers, and calling out events from a list. I'm not a programmer. I'm sure someone could figure it out if need be, but it simply hasn't been necessary.
At the most basic level, it'd be cool if there was a simple mod where I can "create new module". Make it so I can run a timer, make raidwarn or raid say messages, raid chat, whispers, or whatever on set times.
Slightly more advanced would be to make it so you could have it watch for specific messages in the combat log and again, make announcements or trigger an announcement chain.
There are other things involved with mods, but that would cover the basics, and would allow everyone to make more customized mods for their own guild without having to worry about in house coding.
Both La Vendetta and Natur Enemy Cast Bars provide a function where you can broadcast a countdown or a repeated timerbar to your raid via script command, which is usually going to be enough until you can get a proper mod written.
Beyond that, coding a new mod for BigWigs is pretty simple if you look at a couple old ones; most of the research time in writing a new mod is figuring out what to trigger from and the intervals.
Melador> Incidentally, these last few pages are why people hate lawyers.
Viator> I really don't want to go all Kalman here.
Bury> Just imagine what the world would be like if you used your powers for good.