For those out there who feel that editing XML files might be too confusing (or, like me, are just too lazy to go editing through tons of XML-files manually) I'd like to present a small unit-editor. What i've tried to do with it is to make it as easy to fill in most of the data as possible, with dynamic lists for items like sound-effects, background-images and equipment that will update themselves as you add more content to the game.
31.07.2010:
Ok, with Beta 4 now out i've been able to go along way towards finishing this editor. It now automatically builds list of the following things:
Still left to do:
Huge thanks to John Hughes for having the patience to test this for me.
If anyone wants to try it out then the latest version can be found here.
http://www.megaupload.com/?d=52S5UTJQ
New stuff:
Lol, I was just thinking about something like this and here it is.
It's looking nice.
I'd like to try it out.
What I'd really like, though, is to know how to make one. I bet it's really simple once you know how to do it, but incredibly useful. For this one game alone there could be a dozen types of files for which you could create an editor, and then there are files in other games, files you use at work--I'd really like to know how you made this.
Easiest way i've found in .net goes something like this:
XmlTextReader XmlReader = New XmlTextReader(PathToXml);
While(XmlReader.Read()) //Loops through the xml file one line at a time untill the end.
{
if(XmlReader.NodeType != XmlNodeType.EndElement) //Only the Start and ends of the elements seems to have names. Makes sure that the one currently selected is the start of the element.
switch(XmlReader.Name) //Gets the name of the element and matches it to one of the cases below.
Case "NameOfVariable": //Here you can put for instance KingdomModelType if thats one of the values you want.
XmlReader.Read(); //Reads another line ahead to get to the value part.
Variable = XmlReader.Value; //Saves the value-part to a variable of your choosing. You can also save directly to for instance a text-box.
break;
}
There are some better and way more robust methods for reading the xml-files, but i have no idea how they work.
Thanks. That gives me some good new keywords to search. I found lots of savegame editors written in VB, but not one tutorial on how it was done.
Added some comments to the above explanation. One of the things that seemed a bit strange to me when working with this is that the xml reader seems to treat what we see as one line as 3 or more lines. So if you had the following in xml:
<InfoCardBackground>BG24_Volcano</InfoCardBackground>
And then started reading through it with the Xmlreader it would in a simplified way go something like this:
XmlReader.Read()
"<InfoCardBackground>"
"BG24_Volcano"
"</InfoCardBackground>"
I recommend using a program called Ultra Edit. Best scripting tool I've ever used. It's awesome. Do a Google search on it and I'm sure you'll find a free-ware version or trial version that will do the trick as long as you can complete your work before the 30 day trial runs out. If not, then edit your registry, take all the entries for it Out of your Registry, then it will re-install with a new 30 days of trial time. Is doing that Illegal? No, it's a "grey area". You aren't cracking anything or applying some illegal crack. You're mearly editing Your Computers Registry.
Warning: I take NO responsibility if you Don't know how to properly edit your Registry. If you accidentally edit out the wrong thing you can f'k your computer up to the point that you may need to do a total wipe and re-install of your OS. You have been warned. Registry Editing is ONLY for those who KNOW what they are doing. Use caution.
Alternatively, if you feel the people who invested the time to create Ultra Edit did a good job, you could pay them for their time and effort by buying their product once you've tried it.
That's what I did. I bought a boxed copy with a license years ago back when I was still working on UO. I just brought up the other way for those who might only need it temporarily. If you know what you're doing as far as the scripting goes I really can't see a reason someone would need it for longer the 30 days anyway. If so though, the makers of Ultra Edit do indeed deserve money for their creation. As I said, it's the best scripting Tool I've ever used, and let me tell you, over the years I've tried a LOT of scripting programs. Ultra Edit is by far the easiest to understand and use even for beginners.
I use JCreator and NetBeans, but then again, I only do java so far. JCreator is alot nicer than you might think, since it doesn'tt mess anything up at all. NetBeans is graphical but adds dozens of things I don't have a clue what they do. I did a java based editor for html with a cousin of mine, should be easy to do an xml one. But if this one works, that would be pointless. Java has predefined xml classes I have never looked at, but they are there.
Why not just download Visual Studio Express? It's free, and all the screenshots Frogboy posts with the XML files are from VS
Pretty much that.
just use notepad wonder if they will do something from making your Sov look female and yet be male and have sons that look female... weird but it happened.... did it while i was bored
eclipse
There are two huge benefits to this:
1. It opens up .xml modding to people who are afraid of XML
2. It saves you from having to look up what X item or unit is called. It's a database and editor in one, so you don't have to work in your editor (Notepad) while consulting your database (probably another Notepad) with your other hand.
The editor could be further improved by including thumbnail images of the items, units, building types, and so on.
This is one of the things that i'm trying to focus the most on. Untill Beta 4 goes live and i get a look at the finished structure of the game i wont know how much i can make an automatic lookup for, but being the lazy git i am i'll try to make things as effortless as possible.
Would something like this work?
http://img27.imageshack.us/i/equipmentbrowserwiththu.jpg/
edit:
Like i mentioned in the OP, this is intended for people who does not want to edit the xml files manually, either because they're not comfortable with it or because they're too lazy (like me) to run around looking up item-codes, color-values and background images manually. Once beta 4 arrives i'll be starting on a modding-project with a mate of mine where i suspect we'll be creating quite a lot of new units and this program was originally intended as a tool for serial-producing a large number of units quickly.
That's awesome.
Updated OP with latest version and some general information.
Dioxus are you still supporting this tool?
I did a search on Ultra Edit and found a list of Open Source (which is free) alternatives: http://www.osalt.com/ultraedit.
Another tool to consider is Multi Edit (http://www.multiedit.com/). I used to use this editor back in my days of programming in Clipper, and I remember it supported many types of languages. I haven't done anything with XML, but for those looking for an editor, it's something to consider.
But as with SoonerToucan, I'm also wondering if the Unit Editor is still being supported?
Grab Notepad++ if you want a robust text editor. Much the same as Ultra Edit (I actually find it a wee bit better) and it's freeware (released under GPL license)
As for reading XML files. In C# you'll ideally want to read it into an XDocument, which if memory serves me right can be done from an XmlReader. Gives you the ability to query for elements and attributes. Not only that, but it will give you the ability to validate the XML on load rather than crashing on malformed XML half way through.
For Java JDom or Dom4J are good alternatives. Been a lil while since I read XML from a file, but I seem to recall Document and DocumentBuilder being something you used with an InputStream
Hmm...........
I have no idea how to get it to work......
lots of exception error....and its not load up any setting at all....
Hey brother, this is not working. A lot of errors. I would like to use it.
is this going to be updated ?
Probably not. Dioxus seems to be long gone from this forum. His last login was before the retail release of elemental. I have been playing with the idea of creating a unit maker, though I currently have a lot of things I want to do first.
Questions: Can I use this to make enemy units and creatures?
Can I use it to make Armies of said units?
How much of their information can I edit?
There are many great features available to you once you register, including:
Sign in or Create Account