World of Warcraft XML Support in Komodo IDE

I’ve been doing a lot of World of Warcraft addon development lately using Komodo and one of the main reasons I love this IDE is the powerful autocomplete functionality it has for some of my favorite languages (including some specific libraries like jQuery as well). Although I know Lua fairly well, I still have to look up a fair portion of the attributes when doing XML layouts. I knew that Komodo could do XML autocompletion based on using it for HTML, so I decided to try to figure out how to do it. Turns out it’s pretty simple, but there was a bit of trial and error in this particular case.

XML autocompletion in Komodo is handled by using catalog files that link external links to a local file. The local file is in either .dtd or .rng format. Initially I ran into some problems with this because WoW uses schema (.xsd) which is apparently not supported. So it’s a bit trickier in this case, but I got it figured out with some help from Komodo’s outstanding technical support crew (thanks Troy).

Step One:
Get the .xsd file. It doesn’t ship with WoW, at least not in an uncompressed form. So go to http://us.blizzard.com/support/article.xml?locale=en_US&articleId=21466 and grab the http://us.media.blizzard.com/wow/interface/WoW_Interface_enUS.zip file or if you’re not in the US, a more appropriate version. You can also grab the WoW artwork from this page if you want to get a feel for how the WoW graphics files are laid out or you want to do some customization. Once you get the file, unzip it wherever. To keep things tidy, I unzipped it in my WoW directory. It will expand into two folders: AddOns and FrameXML (inside the top level directory: WoW_Interface_enUS). FrameXML is what we’re interested in. Inside FrameXML is a file called UI.xsd. This is the XML Schema for World of Warcraft’s User Interface libraries.

Step Two:
Convert the .xsd. Initially I tried this project with the .xsd and it didn’t work at all. So I was curious as to why, so I fired off an email at Komodo tech support, and found out that Komodo doesn’t actually support catalog files linked to an xsd file. So the options they do support are DTD and RelaxNG. Well I knew DTD better than RelaxNG, so I decided to convert the file from Schema to DTD and then try that. But for some reason this didn’t work, so I decided to try the original suggestion I received from ActiveState and convert the file into .rng (RelaxNG) format. So I created a stub file called UI.rng, then I went to this website: http://debeissat.nicolas.free.fr/XSDtoRNG.php and copied the contents of the UI.xsd file into the left panel of their schema conversion tool, hit convert, then copy/pasted the contents of the right panel into UI.rng. There were some problems with the conversion between WoW’s schema and RelaxNG because RelaxNG doesn’t understand the substitutionGroup mechanism. So I modified the .rng file to accommodate for this, you can get the working file here or view the code for modifications here.

Step Three:
Create the catalog. This part is really really easy. So easy in fact, there is a lot of room to over-complicate it if you’re not careful. The typical XML declaration at the beginning of a WoW XML file contains a few urls, initially I tried to use the url in my xsi:schemaLocation. Don’t. The url we’re linking on here is the xmlns url, which for these files should always be http://www.blizzard.com/wow/ui/ and then beyond that you just have to remember that the local uri you’re linking to has to be relevant to the location of the catalog file. So we create a catalog.xml file (I’m not sure if the name is mandatory, I didn’t test it, but every default Komodo catalog used it, so I did as well) and fill it with the following contents:


<?xml version="1.0" encoding="UTF-8"?>

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
         prefer="public">
    <uri name="http://www.blizzard.com/wow/ui/"
         uri="UI.rng"/>
</catalog>

With the UI.rng file being in the same directory in this case.

Step Four:
Tell Komodo about your catalog. Open up your preferences (location will vary based on OS), then go to Languages->XML Catalogs. Click the green plus (+) button, and browse to your catalog.xml file. Open it, then click OK at the bottom of the preferences pane. Restart Komodo, and you should be granted with fancy new autocompletion.

Anyway, hopefully this helps some others who are using Komodo for their WoW development, and if you’re not using Komodo, you should definitely check it out. It’s definitely the best multi platform (Linux, Windows, Mac OSX), multi language IDE I’ve ever used.

Domesticating Programmers

The trouble with domesticating programmers, like any other wild animal; is that you lose out on what made them special in the first place.

First an analogy:

In the wild lives a beautiful panther. It’s a perfect hunter, you watch it and you notice how it excels at what it does, and then you think to yourself; “I have mice in my house; this thing would be an amazing mouse catcher”. So you befriend the panther (shut up, it’s a story…) and you bring it home. It cleans out your house of mice and then when it runs out you feed it cat food. You keep it inside because you don’t want it to run away, and you try to keep it up during the day so you can play with it. The panther begins to adapt to the point where it stops trying to get outside, and it’s not awake at night, and admittedly you’ve killed your mouse problem. But now the panther is a useless hunter, it can’t hunt in it’s native environment, and it’s not used to needing to find food anymore and it’s lost the thrill of the hunt. Now it could never compete with other panthers for food, and it will never be able to go back to what it was best at; hunting.

Had you just maintained a bond but not decided to assert control, you could have harnessed the panther’s nature. You could have been eating fresh game alongside your friend every night. But in an attempt to force barriers and controls you’ve killed the nature of the beast and lost everything that made the panther special. Now you just have an elaborate mouse trap.

Back to our world:

Many of the best programmers are nocturnal, passionate creatures, who take deep pleasure in the hunt. They hunt for challenges, they hunt for bugs, they hunt for problems and try to solve them. They hunt for innovation, new ways of doing things differently and better. They work absurd amounts of time, often with no ambitions other than sharing their achievements with the community so that everyone can benefit. Not all programmers fit this mold, but these are the panthers of the programming world. The “night programmers“. In the wild, these programmers will not settle until they solve an issue, they work tirelessly, cutting off problems before they happen, completely aware of their environment and the elements around them. Their home computers are built as development environments, fast internet, fast computers, multi-tasking machines running a cadre of development tools, set up to deliver any imaginable resource to the programmer in a blink of an eye without interrupting the flow of code or thought. Working uninterrupted and isolated for huge chunks of time.

Now if you take this same programmer and move them into an office environment, you force them to adapt, and therefore they’re no longer working where they are most comfortable or efficient. They are usually easily distracted by their new surroundings, like a wild cat, eyes darting around at everything that moves or makes a noise. They’re naturally nocturnal, so by noon, their mind is in sleep mode and although they’ll dutifully work through it, they’re far from working at peak mental aptitude. Employers can rarely afford (or aren’t willing to buy) the top of the line hardware that the programmer keeps at home, so the computer is usually slower, not preloaded with their tools of choice, and often the office’s development practices prevent the developer from re-creating their home environment. Constant interruptions to deal with clients or meetings prevents a solid and steady workflow, and the annoyance of having to answer to people who don’t understand the complexity of what they’re doing enough to appreciate their talents or perseverance constantly leaves a bitter taste in their mouth.

I think one of the biggest problems humans have is not recognizing that we’re also wild animals. We’re pack animals that thrive on specialization. when people are doing what they love and what comes naturally to them, they excel and have limitless potential. And if society utilizes this strength, everyone thrives. But too often the scramble to survive in the business world forces people out of what they do best. Forces them to fit into molds, and forces them to defy their nature, and while a handful of people get rich or “successful” off of this system, society as a whole is detrimented by it constantly. We will never reach our full potential until humanity learns to embrace our wild nature and realizes that not everyone is the same, and everyone has different strengths, weaknesses, work habits, schedules, passions, and all humans must be allowed to be individuals.

Welcome

01001001 01101110 01100011 01101111 01101101 01101001

01101110 01100111 00100000 01010100 01110010 01100001

01101110 01110011 01101101 01101001 01110011 01110011

01101001 01101111 01101110

Return top