Generated maps Study existing code and settings - aoemods/wiki GitHub Wiki
Studying Lua code from official skirmish maps
Studying the Lua code from official skirmish maps is a great way to accelerate learning. The "terrainlayout" directory, located within the archive Data.sga, contains useful library functions and the Lua code used to generate these official maps.
How to extract the contents and access the Lua code:
- In the Age of Empires IV Content Editor, from the top menu, navigate to File » Open (not "Open Mod").
- Navigate to your installed Age of Empires IV game directory and open the file: Age of Empires IV\cardinal\archives\Data.sga.
- Once Data.sga is opened, in the directory tree, extract the directory data:scar\terrainlayout to your local disk. You can do this by right-clicking on the folder name, "terrainlayout," and selecting "Extract."
- Choose a location on your local disk to save the terrainlayout directory.
- You can open and view these extracted files in any text editor/IDE or the official Age of Empires IV content editor.
Studying attributes/settings from official skirmish maps
Observing existing settings from an official map can serve as a guide when configuring your map attributes in map_gen_layout. These may include settings such as resource distribution, contested ranges, erosion, terrain smoothing, and more.
- In the Age of Empires IV Content Editor, go to the top menu and navigate to: Attributes » Open Attributes. You won't see "Open Attributes" if the Attribute Editor has already been opened.
- Once the Attribute Editor is launched, again from the top menu, navigate to: Attributes » map_gen » map_gen_layout.
- Within the map_gen\map_gen_layout window, in the left pane, you can navigate down to the attributes/skirmish_maps directory. Inside this directory, clicking on any of the map files will display the map settings in the right pane.