Creating .xml files for custom RMS
From AgeofWiki
Using xml files with your custom random map scripts
by RF_GandalfCustom random map scripts must have an accompanying file with the same name with the extension " .xml". These are simple text files that tell the game information about loading your map script. Since the 1.05 patch, ES has given us the ability to add information about our map scripts similar to the way the standard map scripts do. Creating an .xml file to go with your custom random map script is pretty easy to do. This is a guide to outline what should be in your xml file.
Following is a copy of the xml file I have created to go with my canyonlands map, posted originally months ago before the 1.05 patch. (I will be updating the download shortly to include this new xml file)
<?xml version = "1.0" encoding = "UTF-8"?>
<mapinfo
imagepath = "ui\random_map\sonora"
displayName = "Canyonlands"
detailsText="The rugged canyons of the American Southwest"
loadDetailsText="The team areas are separated by a deep canyon with a single crossing. Each side contains a trade route and native village - either Commanche or Aztec. There are plenty of bison, pronghorn and a few bighorn sheep to hunt, and lots of silver as well. Deep in the canyon there is usually extra silver and some powerful treasures as well. Note in Free-For-All the trade routes will not appear."
loadBackground="ui\random_map\sonora\sonora_map">
<loadss>ui\random_map\sonora\sonora_ss_01</loadss> <loadss>ui\random_map\sonora\sonora_ss_02</loadss> <loadss>ui\random_map\sonora\sonora_ss_03</loadss>
</mapinfo>
You could use this as a template or open any standard map .xml file in Wordpad or other text editor, save as a new file, then edit as desired. I will describe section by section what you need to do. For each option quotes should be used to enclose the words to be used or files selected.
The initial portion describes the xml language - I don't pretend to understand it and leave it alone.
Note that the mapinfo brackets must include all of these features: imagepath, displayName, detailsText, loadDetailsText and loadBackground.
imagepath is for the graphic used for the small square map picture above the random map selection window. AOE3 looks in the folder: Microsoft Games\Age of Empires III\Art for these graphic files, the line within the quotes refers to the path woithin that folder - in the subfolder ui\random_map. All of these graphic files are in the ".ddt" format. I have not tried to create my own ddt files but found via the internet a viewer to look at them, and generally select one appropriate for my map. If the quotes are left blank or if an invalid file is named, a black square will appear.
displayName is for the name that will appear in the dropdown window where a custom random map is selected - it does not matter what the map file is named - this is the name that shows in the window. This name should be unique to your map or map version because multiple instances of the same name are possible, leading to confusion. There is a character limit - perhaps dependant on screen size and resolution - I know it is 18 characters for my computer. Any name over 18 characters gets truncated at the last full word to fit in the space.
detailsText is for a short description of the map that shows up as a tool tip when the mouse is held over the small map image listed above under imagepath. I have not tested to see how long a description can be posted, see examples for the ES maps in game.
loadDetailsText is for the more detailed map description to appear in the map startup screen, under the name given in displayName. Again there is a character limit, beyond which the message is cut off. I have not tested the limit - there seems to be room for a fairly good description.
loadBackground is for the graphic to be displayed as the background behind the loadDetailsText message and any screenshots to be displayed. The standard ES maps use an antique map graphic in one of the folders in the Art\ui folder listed above. Again, select the file and filepath you wish to use and list it within quotes. An invalid filename or path will result in a black background.
Be sure all of the above are enclosed by the angled brackets.
Next are the screenshots to be displayed in the lower left portion of the map startup screen. Although these are referenced as being in the Art\ui folder, there are no screenshot images there. I believe these images are actually found in the art_.bar files in the Art folder, and the game opens these files to find the screenshots referenced (I have not opened the art_bar files to confirm this). Anyway, it is likely possible that you can add your own screenshots to the Art\ui folder to use. The program will select, I believe randomly, between any listed here. I tested this with as many as 20 listed screenshots and it seems to select from them all although it seems as the first 3-5 are picked more often (I did not do a mathmatical analysis). Place the filename and path between the 'load screenshot brackets' as in the example above.
The file must end with </mapinfo> as in my example.
Use \n to change lines in the description.
Note that if you start with a standard ES map xml file you must edit out the following: mapinfo details=" " displayNameID=" " loadDetails=" " , or your own details will not be displayed.
If you can produce graphics files with the .ddt format you should be able to add your own graphics for these 2 sites on the map startup screen. I suspect that it would make any map download file larger and more difficult to install, given that many players can't handle installing random maps in the proper location.
Hope this is helpful to any future random map scripters!
