
RMS Tutorials: Custom Beaches
************************************************************
This tutorial assumes that you are familiar with the basic concepts of RM scripting – ie. you understand what all the parts of a standard ES map script do, and you are able to write your own basic scripts. If this is not the case, I suggest you read my
************************************************************
Age of Empires II: Definitive Edition adds a bunch of new beach terrains, in addition to those new ones that were already added in the Rise of the Rajas DLC for Age of Empires II: HD Edition (2013).
In the Definitive Edition scenario editor, you can choose which beach you want to have automatically generated when terrain borders water, but for RM scripting it is not as straightforward.
Normal beach and ice beach are the only beach types that will generate by default, and also the only types that were available prior to the Rise of the Rajas DLC.
I will present two approaches for how you can get your map to use any of the other beach types.
************************************************************
This method involves placing your custom beach type whenever you would normally want to place water. For example, as the map's
Once you have done this, replace this custom beach type with water in the
A simple map that generates a river and lakes with rocky beaches (requires the Definitive Edition)
<PLAYER_SETUP>
random_placement
<LAND_GENERATION>
#const BEACH_WET_ROCK 109
base_terrain BEACH_WET_ROCK
create_player_lands
{
terrain_type GRASS
land_percent 100
other_zone_avoidance_distance 15
}
<TERRAIN_GENERATION>
create_terrain BEACH_WET_ROCK
{
base_terrain GRASS
number_of_clumps 40
land_percent 20
}
create_terrain WATER
{
base_terrain BEACH_WET_ROCK
spacing_to_other_terrain_types 1
number_of_clumps 9999
land_percent 100
}
************************************************************
This method has you place all your water normally. Then, in
A simple map that generates a river and lakes with rocky beaches (requires the Definitive Edition)
<PLAYER_SETUP>
random_placement
<LAND_GENERATION>
base_terrain WATER
create_player_lands
{
terrain_type GRASS
land_percent 100
other_zone_avoidance_distance 15
}
<TERRAIN_GENERATION>
create_terrain WATER
{
base_terrain GRASS
number_of_clumps 40
land_percent 20
}
<CONNECTION_GENERATION>
#const BEACH_WET_ROCK 109
create_connect_all_lands
{
replace_terrain BEACH BEACH_WET_ROCK
terrain_size BEACH 999 0
}
************************************************************
Method 1 has the advantage that you can make beaches wider than 1 tile, if that is what you want. However, it has the drawback that you cannot use this method if you want elevated water, because water in
Method 2 is compatible with elevated water. However, you cannot easily make wider beaches using only this method, unless you combine it with additional code.
Another thing to note is that it is easier to achieve full coverage (if you have very many small clumps of lakes) with
I hope this has been useful!
......../¯/\
......./ / / \ Check out my Blacksmith submissions as well as my Random Map Scripts.
....../ / /\\ \
...../ /_/_\\ \ Proud guardian of the Definitive Random Map Scripting Guide
..../_____\\\ \
....\\\\\\\\\\\\\/ and the Random Map Scripting Links and FAQ thread.
[This message has been edited by Zetnus (edited 03-24-2020 @ 09:23 PM).]