Note: for the examples in this thread I use the Giant Earth, the other names can be found in the corresponding map's threads or in the Map.xml file in the map's folder.
If you are a modder:
You'll need to set this in a SQL file loaded before the file setting the changes to the map (this is to make sure that your XML/SQL file won't fail to load if YnAMP is not activated)
Then see the XML example below to add the code in one of you file loaded after the one creating the table.
If you are not a modder:
See How to create custom.xml and custom.sql to make simple changes and add the XML code in the custom.xml file following the examples below.
This one will replace the sea plot at 21,75 by grassland on the giant earth, closing the strait between Denmark and Sweden.
This one will change some terrain, feature and resource around Riyadh position if CIVILIZATION_ARABIA is in the game, and will close the strait between Denmark and Sweden if CIVILIZATION_DENMARK is in the game.
This code change some terrains, features or resources depending of some configuration options.
You can't change configuration options using the custom.xml or custom.sql method (I may add code to allow a custom_config.xml file at some point), but you can change the Config.xml file of an existing map, the code above is linked to the following code from Config.xml in the Maps/GiantEarth folder
it's the "ConfigurationId" entries which link the setting and the effect on the map.
For all those changes, you can find the type names in the game's files (Terrains.xml, Features.xml and Resources.xml) in "\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data", in the equivalent files for DLC/scenarios or in the corresponding tables if you use a SQL manager.
Note that while you could potentially use a FeatureType entry to add a one-plot Natural Wonder on the map, I'd advise to follow the How to change or add Natural Wonders position of a YnAMP map tutorial for that, as some additional code is required for a placement overriding the game's rules.
If you are a modder:
You'll need to set this in a SQL file loaded before the file setting the changes to the map (this is to make sure that your XML/SQL file won't fail to load if YnAMP is not activated)
Code:
CREATE TABLE IF NOT EXISTS ExtraPlacement
( MapName TEXT NOT NULL,
X INT default 0,
Y INT default 0,
ConfigurationId TEXT,
ConfigurationValue TEXT,
Civilization TEXT,
TerrainType TEXT,
FeatureType TEXT,
ResourceType TEXT,
Quantity INT default 0);
Then see the XML example below to add the code in one of you file loaded after the one creating the table.
If you are not a modder:
See How to create custom.xml and custom.sql to make simple changes and add the XML code in the custom.xml file following the examples below.
- Simple terrain change:
Code:
<GameInfo>
<ExtraPlacement>
<Replace MapName="GiantEarth" X="21" Y="75" TerrainType="TERRAIN_GRASS" />
</ExtraPlacement>
</GameInfo>
This one will replace the sea plot at 21,75 by grassland on the giant earth, closing the strait between Denmark and Sweden.
- Conditional changes, depending of Civilizations:
Code:
<GameInfo>
<ExtraPlacement>
<!-- Around Riyadh TSL -->
<Replace MapName="GiantEarth" X="39" Y="43" Civilization="CIVILIZATION_ARABIA" TerrainType="TERRAIN_GRASS_HILLS" />
<Replace MapName="GiantEarth" X="40" Y="45" Civilization="CIVILIZATION_ARABIA" FeatureType="FEATURE_OASIS" />
<Replace MapName="GiantEarth" X="39" Y="44" Civilization="CIVILIZATION_ARABIA" FeatureType="FEATURE_OASIS" />
<Replace MapName="GiantEarth" X="40" Y="43" Civilization="CIVILIZATION_ARABIA" FeatureType="FEATURE_OASIS" />
<Replace MapName="GiantEarth" X="39" Y="45" Civilization="CIVILIZATION_ARABIA" ResourceType="RESOURCE_STONE" />
<!-- Copenhaguen TSL -->
<Replace MapName="GiantEarth" X="21" Y="75" Civilization="CIVILIZATION_DENMARK" TerrainType="TERRAIN_GRASS" />
</ExtraPlacement>
</GameInfo>
This one will change some terrain, feature and resource around Riyadh position if CIVILIZATION_ARABIA is in the game, and will close the strait between Denmark and Sweden if CIVILIZATION_DENMARK is in the game.
- Conditional change, depending of setup option (advanced modding):
Code:
<ExtraPlacement>
<Replace MapName="GiantEarth" X="31" Y="59" ConfigurationId="ClosedBosphorus" TerrainType="TERRAIN_GRASS_HILLS" />
<Replace MapName="GiantEarth" X="10" Y="67" ConfigurationId="MontSaintMichel" FeatureType="FEATURE_MARSH" />
<Replace MapName="GiantEarth" X="10" Y="73" ConfigurationId="Stonehenge" ResourceType="RESOURCE_STONE" />
</ExtraPlacement>
This code change some terrains, features or resources depending of some configuration options.
You can't change configuration options using the custom.xml or custom.sql method (I may add code to allow a custom_config.xml file at some point), but you can change the Config.xml file of an existing map, the code above is linked to the following code from Config.xml in the Maps/GiantEarth folder
Code:
<Row Key1="Map" Key2="GiantEarth.lua" ParameterId="GiantEarthBosphorus" Name="LOC_MAP_CLOSED_BOSPHORUS_NAME" Description="" Domain="bool" DefaultValue="0" ConfigurationGroup="Map" ConfigurationId="ClosedBosphorus" GroupId="MapOptions" SortIndex="1000"/>
<Row Key1="Map" Key2="GiantEarth.lua" ParameterId="GiantEarthMontSaintMichel" Name="LOC_MAP_MONT_SAINT_MICHEL_MARSH_NAME" Description="" Domain="bool" DefaultValue="0" ConfigurationGroup="Map" ConfigurationId="MontSaintMichel" GroupId="MapOptions" SortIndex="1000"/>
<Row Key1="Map" Key2="GiantEarth.lua" ParameterId="GiantEarthStonehenge" Name="LOC_MAP_STONEHENGE_STONE_NAME" Description="" Domain="bool" DefaultValue="0" ConfigurationGroup="Map" ConfigurationId="Stonehenge" GroupId="MapOptions" SortIndex="1000"/>
it's the "ConfigurationId" entries which link the setting and the effect on the map.
For all those changes, you can find the type names in the game's files (Terrains.xml, Features.xml and Resources.xml) in "\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data", in the equivalent files for DLC/scenarios or in the corresponding tables if you use a SQL manager.
Note that while you could potentially use a FeatureType entry to add a one-plot Natural Wonder on the map, I'd advise to follow the How to change or add Natural Wonders position of a YnAMP map tutorial for that, as some additional code is required for a placement overriding the game's rules.
Last edited: