Generated Maps:Study Existing Code and Settings
Return to Generated Maps - Home
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 skirmish maps.
How to extract the contents and access the Lua code:
- From 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 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
Seeing existing settings from an official map can serve as a guide when configuring your map attributes in map_gen_layout. This could be settings such as: resource distribution, contested ranges, erosion, terrain smoothing, and more.
- From 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 file: Age of Empires IV\cardinal\archives\Attrib.sga
- Once Attrib.sga is opened, in the directory tree, navigate to attrib:attrib\map_gen\map_gen_layout\skirmish_maps\
- From the skirmish_maps directory you can open a map ".rgd" file.
- Open a map rgd file and navigate the data tree to view specific settings.