On this page:
2.1 Dependencies
2.2 Development Environment
2.3 Transpiling Files
8.18.0.13

2 Getting Started🔗ℹ

This assumes you are familiar with the AoE2 RMS already, so it goes over how to start using this package instead. For resources regarding the AoE2 RMS, please see following document.

2.1 Dependencies🔗ℹ

Unfortunately, unlike with the actual .rms scripts, the process of using aoe2-rms is a bit more involved. First, take care of setting up dependencies:

  1. Install Racket

  2. raco pkg install aoe2-rms
    For more info see Installing Packages.

2.2 Development Environment🔗ℹ

You may use any editor you like. See Command-Line Tools and Your Editor of Choice for list of editors that have Racket integration. I use Visual Studio Code with Magic Racket extension. Example of how that looks can be found at YouTube.

2.3 Transpiling Files🔗ℹ

Create a example.rkt file anywhere:

"example.rkt"

#lang aoe2-rms
 
(define (create-player-desert player)
  (create-land
   (terrain-type 'DESERT)
   (land-percent 3)
   (land-position 50 50)
   (assign-to-player (add1 player))))
 
<PLAYER-SETUP>
(direct-placement)
 
<LAND-GENERATION>
(for-each create-player-desert (range 2))

Then, you can convert it into random map script using Racket by running:

racket example.rkt

Thanks to the #lang aoe2-rms line at the top of file, Racket will recognize that this is meant to be random map script and spits out following text:

<PLAYER_SETUP>
direct_placement
<LAND_GENERATION>
create_land {
 terrain_type DESERT
 land_percent 3
 land_position 50 50
 assign_to_player 1
}
create_land {
 terrain_type DESERT
 land_percent 3
 land_position 50 50
 assign_to_player 2
}

You can also specify file to write the output to the "-d" flag, like so:

racket example.rkt -d example.rms

With above resulting in new "example.rms" file instead. In practice, one would setup some file-watcher script instead, re-running the racket -d example.rkt command when source file changes.

That is all you need to know to convert #lang aoe2-rms files into Random Map Scripts. Head on to Syntax section for list of procedures and forms available in aoe2-rms language.