Version History
- 25th July 2004 - Stuart - Indexed, OK.
- 22nd Jan 2005 - Jeffrey - Merged the Implementation documents.
- 23rd Jan 2005 - Stuart - Finished merge, cleanup, and integrated with TDD.
- 24th Jan 2005 - Jeffrey - Updated the conditions list
- 25th Jan 2005 - Jeffrey - Updated the triggers section
- 25th Jan 2005 - Jeffrey - Added General Functions section and added 2 new methods to the surface object.
- 25th July 2005 - Jeffrey - Removed connection constants and replaced them with objects
- 25th July 2005 - Jeffrey - Added preventWalk and preventBuild methods to area
- 27th July 2005 - Jeffrey - Changed Elevation and Depth from one int to a min/max range
- 13th Aug 2005 - Jeffrey - Added Biomes specification
- 13th Aug 2005 - Jeffrey - Replaced Settings object with a more extensive Sessions object.
- 13th Aug 2005 - Jeffrey - Added 2 new methods in the surface object to mirror one of Matei's functions.
- 14th Aug 2005 - Stuart - Converted document to Wiki format.
- 12th Jun 2017 - bb - Nuke references to old random generator functions.
Summary: This document details the functionality of Random Map Scripting which will be used to allow scripters to create the environment that players will need to play in.
Generic
sin(int), cos(int), tan(int), log(int)
Trigonometric functions were really depended on when scripting for AOM. So, why not add them by default here.
Sessions
The Sessions object returns session data such as player civilizations, game types, etc.
Areas
The Area object is the parent of most basic functionality that would be inherited by the other more specific objects such as Water, Region, Connection, and Constraint. If it's something that all objects share, it would be put in the Area object.
In fact, The map itself is a predefined area whose size is set from 0 to 1 (the center being 0.5).
Surfaces
The Surface object is simple. It applies, modifies, and removes terrain from a specified area. It also sets the elevation of land from the parent area, or the depth of water. It can be implemented on regions, connections, and water.
Constraints
The Constraint object is used to define restrictions. It applies strict rules to make the map work in a specific way.
Connections
Connections are special areas used to "connect" 2 or more areas.
Regions
The Region object is an area that a surface and connection can be applied to. It may in the future contain unique methods, but for now, it's just the only way to make an area into actual land.
region(parentArea)
This is the constructor. it defines its parent area.
Water
The Water object is not much different from the Region object except for the fact that it's used to create water. The surface object defines the water's depth. If terrain is set, it's used as the bottom level of the water which can be used to create some cool effects. Maybe we can add some more methods like making stronger waves and other graphical goodies like that if the engine will support it.
water(parentArea)
This is the constructor. it simply defines its parent area.
setType()
This method defines the type of water to use.
Territories
The Territory object is a predefined area that's generated to divide the parent area equally by the amount specified by the developer. The parent area can be any defined area (Area, Region, Connection, Water, etc). Each territory/province is given a multi-dimensional ID according to position. IDs are generated clockwise starting from the territory/province positioned to the topleft of the area.
Biomes
The Biome object is a parent that gets extended by predefined or user-defined biomes. It's basically an interface that Biome objects should follow. Biomes are a higher abstraction of other objects such as Surface and Objects.
Triggers
A trigger is an indefinate iteration that can be stopped and restarted. Triggers are "described" in regular functions. They are necessary to allow for dynamic actions and reactions using conditions and effects. But you don't even need triggers and functions to take advantage of conditions and effects. Conditions and effects are regular functions that can be used globally within the script, and if you need to run it once at startup with no iteration, you are free to do so.