On this page:
%include-drs
%include-xs
8.18.0.13

3.5 Including Files🔗ℹ

The standard maps include shared files for the resource generation.

  • In AoC/UP this is found within the gamedata_x1.drs file. You can open the drs file with any text editor and look for the relevant part.

  • In vanilla HD you can find the land_resources.inc file in the gamedata_x1 folder.

  • In DE you can find the GeneratingObjects.inc file in the gamedata_x2 folder. Additionally you can find shared files for seasons, elevation, animals, water mixing, etc.

The file random_map.def is always included, without having to specify it. It contains all the predefined constants.

VERY IMPORTANT: Included rms files are NOT transferred in the lobby! This means:

  • You CAN include any of the standard files that are part of the game, because other players will already have them in their directory.

  • You CANNOT include custom files, unless everyone in the lobby has the file. So you can include custom files with full conversion mods, because all players will need to have the mod to be able to play in the first place.

procedure

(%include-drs path)  void?

  path : any/c
Game versions: HD/DE (in AoC it is used for the built-in maps, but doesn’t seem to work for custom maps)

Arguments: path - name (or path and name)

Valid file extensions are: rms, rms2, inc, def

You can navigate to a parent directory with "../".

Include a file located in the gamedata folder.

If you include a file somewhere else, the file path must be relative to the gamedata folder.

Example: Include the DE seasons file, so that you can use it in your own script, without having to set up your own terrains.
#lang aoe2-rms
 
(%include-drs "F_seasons.inc")

Example: Include that classic land and water resources file from AoC.
#lang aoe2-rms
 
(%include-drs "land_and_water_resources.inc")

Example: Make a custom version of blind random.
#lang aoe2-rms
 
(%random [20 (%include-drs "Arabia.rms")]
         [20 (%include-drs "Baltic.rms")]
         [20 (%include-drs "Gold_Rush.rms")]
         [20 (%include-drs "Islands.rms")]
         [20 (%include-drs "Team_Islands.rms")])

procedure

(%include-xs path)  void?

  path : any/c
Game versions: DE only

External reference: .xs scripting in Age of Empires II: Definitive Edition, XS Scripting For Beginners

Arguments: path - name (or path and name)

  • Valid file extensions are: xs

  • You can navigate to a parent directory with ../

  • BUG: You cannot surround your path with quotation marks

Include an xs file, located in the xs folder.

  • If you include a file somewhere else, the file path must be relative to the xs folder.

  • The path can also be relative to the xs folder in player profile, rather than to the xs folder in the main game directory.

  • Unlike included rms files, included XS files DO transfer automatically to players and spectators.

Example:
#lang aoe2-rms
 
(%include-xs "file.xs")