February 17th, 2003
|
#9 |
Join Date: July 1st, 2002 Status: Away Rep Power: 31 | *Copied from a AI help doc
The AoM AI scripting system is a very powerful system that allows the user to craft the AI using the same language as the folks at Ensemble Studios. While this is a useful enduser feature, it is officially unsupported.
The high level overview for creating your own random map AI scripts is as follows:
• Write your random map script.
• Add an XML file into your AI directory following the format of default.xml, defaultboom.xml, or defaultrush.xml.
• See your AI appear in the list of dropdown choices when you run the game.
• Debug it using the ingame debugging facilities:
o Add “aiDebug” to your user.cfg file in the startup directory.
o When the game is running, hit ALT+SHIFT+D to bring up the debugger.
For a scenario, the steps are largely the same, except that you need to associate the AI script filename with the right player via the scenario editor (Player Data dialog).
A list of the type enumerations and function calls that can be made from the AI scripts is included at the end of this document.
AoM includes a source debugger for your XS scripts. This is accessed by including a line with “aiDebug” on it in the user.cfg in the Startup directory of your AoM installation. If you do not have a user.cfg file, create one with any text editor. Once this is in your user.cfg, hitting ALT+SHIFT+D will bring up the debugger. Different XS runtimes (AI for each player, triggers, etc.) will be available for debugging. The debugger is an unsupported feature.
You can also use the “aiEcho(…)” syscall (see the syscall reference at the end of this document) to print out debugging strings, etc. during the execution of your AI. To see these, you must put a “showAIEchoes” line in your user.cfg. |
| |
| |