So after many many years of playing Civ 5, I've decided to try my hand at modding a few things here and there that I have found particularly irksome over the ages. The first thing I want to tackle is how automated workers keep spamming trading posts over literally EVERY SINGLE TILE instead of generally more useful improvements like farms or mines. I've tried attacking this from a couple of angles. First thing I tried is to prohibit building trading posts on any tile that wasn't marsh or jungle, but that didn't seem to work. Next thing I tried was a bit simpler, just to prohibit building trading posts on grasslands tiles...but that didn't work either.
Being new to this, I have been using AI to help generate the code. So I'm not sure if it's the AI not doing something quite right or if it's just not possible to mod out the behavior at all. I've pasted a couple of the examples that I've been trying below, if someone could take a quick look and see what I might have been doing wrong that would be a great help. Thanks!
XML file:
<GameData>
<!-- Deletes the rule that allows Trading Posts to be built on Grassland tiles -->
<Delete table="Improvement_ValidTerrains"
ImprovementType="IMPROVEMENT_TRADING_POST"
TerrainType="TERRAIN_GRASS"/>
<!-- Optional: Reduces AI bias towards building TPs globally -->
<Improvements>
<Update>
<Where Type="IMPROVEMENT_TRADING_POST"/>
<Set AIWeight="0"/>
</Update>
</Improvements>
</GameData>
Modinfo file:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="99999999-ABCD-4321-ABCD-000000000001" version="1">
<Properties>
<Name>No Grassland Trading Posts</Name>
<Teaser>Prohibits building Trading Posts on Grassland tiles.</Teaser>
<Description>Automated workers will no longer build or maintain Trading Posts on Grassland.</Description>
<Authors>User</Authors>
<HideSetupGame>0</HideSetupGame>
<AffectsSavedGames>0</AffectsSavedGames>
<SupportsSinglePlayer>1</SupportsSinglePlayer>
</Properties>
<Files>
<File import="0">Database.xml</File>
</Files>
<Actions>
<OnModActivated>
<UpdateDatabase>Database.xml</UpdateDatabase>
</OnModActivated>
</Actions>
</Mod>
Being new to this, I have been using AI to help generate the code. So I'm not sure if it's the AI not doing something quite right or if it's just not possible to mod out the behavior at all. I've pasted a couple of the examples that I've been trying below, if someone could take a quick look and see what I might have been doing wrong that would be a great help. Thanks!
XML file:
<GameData>
<!-- Deletes the rule that allows Trading Posts to be built on Grassland tiles -->
<Delete table="Improvement_ValidTerrains"
ImprovementType="IMPROVEMENT_TRADING_POST"
TerrainType="TERRAIN_GRASS"/>
<!-- Optional: Reduces AI bias towards building TPs globally -->
<Improvements>
<Update>
<Where Type="IMPROVEMENT_TRADING_POST"/>
<Set AIWeight="0"/>
</Update>
</Improvements>
</GameData>
Modinfo file:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="99999999-ABCD-4321-ABCD-000000000001" version="1">
<Properties>
<Name>No Grassland Trading Posts</Name>
<Teaser>Prohibits building Trading Posts on Grassland tiles.</Teaser>
<Description>Automated workers will no longer build or maintain Trading Posts on Grassland.</Description>
<Authors>User</Authors>
<HideSetupGame>0</HideSetupGame>
<AffectsSavedGames>0</AffectsSavedGames>
<SupportsSinglePlayer>1</SupportsSinglePlayer>
</Properties>
<Files>
<File import="0">Database.xml</File>
</Files>
<Actions>
<OnModActivated>
<UpdateDatabase>Database.xml</UpdateDatabase>
</OnModActivated>
</Actions>
</Mod>
?