Age of Empires III

Scripting for Age of Empires III

     BEFORE WE START, REMEMBER THIS! NEVER EVER - EDIT ANOTHER PERSON'S MAP WITHOUT THEIR PERMISSION! Making even a slight change to any map will have it so that anyone who joins your game, replaces their map with your edit and ruins the map basically. Now to continue...

     I always get asked how I make my Random Map Scripts. Many believe, for example, that Fort Wars is a scenario created through the ingame editor. That is simply impossible. First of all, the game currently does not support any scenarios to be played online. Second, random environments along with varying number of players are impossible in a scenario. Finally, there are thousands of trigger effects, multiplied by the number of players. In the editor, one would have to input each trigger one at a time (and account for how many players there are). It just can't be done. Fort Wars is indeed not a scenario, but an RM (Random Map) script.

     So how does one create a Random Map Script? Notepad. Every line, every bit of code, is typed by hand. I suggest getting Notepad 2 or some other text editor that supports highlighting; it makes reading code much easier.

     There are indeed Random Map generating programs at various websites. However, I suggest learning to code yourself. These programs basically allow you to set certain basic aspects of a map such as size and terrain. They are very limited compared to real scripting. Scripting can be compared to art. You can't create a tool which 'generates' masterpieces. Perhaps it can allow you to create a basic face and customize a few aspects, which is what these RM generators basically do. If you want to create scripts with real potential, learn to code.

     A great guide can be found at:

Hyena Studios - AOE3 RMS Tutorial - This is probably the most detailed guide out there. It covers everything you need to know to get started.

Miscellaneous Scripting Information - Very useful references by me that are not well documented or known. You should have a decent understanding of RMS first however.
Code Behind Fort Wars - A breakdown of all the tricks and code used to make the Fort Wars custom map, from XS injection to kb queries.

     Once you've gotten started, you might also want to look at:

Age of Wiki - RM Scripting - Large compilation of information and references for RMS.

     That is basically everything you need to script. Much of it you must come up or figure out on your own. Like art, you can't 'learn' to make a masterpiece; you can only be taught how to use the tools, which in this case is how to code.

     If you still need help, feel free to post in the Forums or visit Age of Empires III Heaven's Design Forum, which has a pretty good and active community.

     You will also find the Miscellaneous Scripting Information on this site useful.