Define grouping
From AgeofWiki
| Explore the Editor Functions from |
| The Edit Menu |
| Edit Menu |
| Editor Functions |
This is a guide to using a new feature in Age of Empires 3, groupings, to enhance Random Map Scripts. A 'Grouping' is a collection of objects, terrains, and elevations/contours that are placed graphically using the scenario editor, then saved to an xml file to be used later in a RMS or in another scenario (see Load user-made grouping ). Two examples of groupings used by ES in the standard map scripts include the native villages (collections of native trade posts, native buildings and objects, and usually some dirt-like terrain) or the groups of grasses and flowers that appear all over the map on the Great Plains map. These are fairly easy to create and use, and will give great ability to add precise detail previously unavalable in random maps. This is a step-by-step guide to creating your own groupings.
First, open the Scenario Editor and start by placing objects and terrains exactly how you want them to appear. Be sure that the objects placed are made as 'Gaia', not as belonging to any of the players. You might want to place certain terrains to appear in your grouping, or you might want the terrain in the editor to be transparent so the grouping appears natural with the terrain of any map it is eventually used on (in which case leave the default terrain as your base).
Second, using the 'Edit' menu, select 'Define Grouping'. This will allow you to click and drag a blue outline around the area you want to save. The blue selection box follows the lines of the Terrain grid. As long as the center-of-gravity of a building is inside the selection box, it will still be included, but smaller objects on the edge can be easily cut off, so be careful that your outline includes them. You can re-do your outline until you are satisfied. Then do Ctrl-C to define the outlined area as a grouping.
Next a 'Save Grouping' box appears as shown at top. If you want to have the terrains in your grouping appear as you have made them, leave the Transparent Terrain as None; if you want the grouping to be saved without a defined terrain, click the drop down arrow and select terrain\great_plains\default, which is the basic green terrain found by default on the Scen Editor - this makes that green terrain transparent. You can also paint a small area of terrain within your grouping and make the default terrain transparent to save only the terrain you want.
Ignore Placement Rules: As seen under Objects>Ignore placement restrictions, allowing your buildings and units to ignore placement restrictions means they will be saved and loaded as-is, even if they overlap. If you do not tick this box, some or all of your overlapping or mashed buildings and units may disappear when the saved grouping is loaded and placed again in a different scenario.
Select as Single Unit: Allows you to load, place, and move the grouping as a single coherent unit. If you do not tick this box, once you place the grouping, the grouping's buildings and units may be moved around individually. If you do tick this box, some or all of the grouping's buildings and units will move as a group, so if you click and drag one building, the rest of the grouping's objects will follow in place.
Include heights/cliffs: If your grouping includes elevations or cliffs, you must tick this box to save the elevations/cliffs with the grouping. When you load and place the grouping, the elevations and cliffs will be rendered relative to the underlying terrain (so it's best to place on a flat surface).
When you are done setting up your grouping, click OK, and this brings up a 'Save File' box, in which you must enter a name for your grouping, then click save to finish the job. The file is saved in the folder: My Documents\My Games\Age of Empires III\rm\groupings as an xml file type.
Note: Bodies of water are not saved in custom groupings. The elevations and contours of the shore and lake bed will appear, but will be empty and dry.
If you want to edit your grouping or place it somewhere in the Scenario Editor, select 'Edit>load user-made grouping'. This allows you to select any grouping you have made or stored in the abovementioned grouping folder. Similarly, you can load one of the preexisting groupings made by ES using the 'load built-in grouping' feature in the 'Edit' menu. These files, however, are stored in a different folder, under your game installation folder, which is by default Program Files\Microsoft Games\Age of Empires III\rm\groupings. If you edit and save any grouping, they are saved back to the folder in My Games, not in the game install folder.
Finally, you need to be able to use the grouping in a RMS. This involves two parts. First, even though custom RMS are stored as .xs and .xml files in your folder: My Documents\My Games\Age of Empires III\rm and it would seem that any groupings used would need to be in the groupings folder of that directory, the game instead looks for any grouping used by either a standard or custom RMS in the folder: Program Files\Microsoft Games\Age of Empires III\rm\groupings. So after you are done creating your custom grouping, copy that xml file to the folder: Program Files\Microsoft Games\Age of Empires III\rm\groupings. Then you must learn how to use the grouping in your random map script. The easiest way to learn this is by looking at the standard ES random maps to see how they script for these. The script uses similar language to that for defining and placing objects, except that the proper commands involve a grouping rather than an object or item. I would suggest looking at Great Plains since there are examples of scripting for both the native villages and the grass groupings.
