World's most basic mod, but still won't work

shamrock

Chieftain
Joined
Jul 15, 2001
Messages
24
Location
Xenia, OH
This is my first attempt at a mod, so the reason why it's not working is probably extremely simple. Nevertheless, I'm not seeing it.

All I want to do is prevent settlers from founding cities on any terrain other than tundra. My XML file (CityTerrains.xml) is:

<GameData>
<Terrains>
<Update>
<Set Found="false"/>
<Where Type="TERRAIN_GRASS"/>
<Set Found="false"/>
<Where Type="TERRAIN_PLAINS"/>
<Set Found="false"/>
<Where Type="TERRAIN_DESERT"/>
<Set Found="false"/>
<Where Type="TERRAIN_SNOW"/>
</Update>
</Terrains>
</GameData>

The resulting .modinfo file is:

<?xml version="1.0" encoding="utf-8"?>
<Mod id="c2e5ad3a-f4d5-451f-92e6-002b0ac5402d" version="1">
<Properties>
<Name>Perfectionist</Name>
<Stability>Alpha</Stability>
<Teaser>A perfectly balanced map containing 8 civs and 12 city states.</Teaser>
<Description>A perfectly balanced map containing 8 civs and 12 city states.</Description>
<Authors>Erin Ryan</Authors>
<HideSetupGame>0</HideSetupGame>
<AffectsSavedGames>0</AffectsSavedGames>
<SupportsSinglePlayer>1</SupportsSinglePlayer>
<SupportsMultiplayer>1</SupportsMultiplayer>
<SupportsHotSeat>0</SupportsHotSeat>
<SupportsMac>1</SupportsMac>
<ReloadLandmarkSystem>0</ReloadLandmarkSystem>
<ReloadStrategicViewSystem>0</ReloadStrategicViewSystem>
<ReloadUnitSystem>0</ReloadUnitSystem>
</Properties>
<Dependencies />
<References />
<Blocks />
<Files>
<File md5="640A2DA4FB5E2AADD942C5059471E5C9" import="0">Balanced4.Civ5Map</File>
</Files>
<Actions>
<OnModActivated>
<UpdateDatabase>CityTerrains.xml</UpdateDatabase>
</OnModActivated>
</Actions>
</Mod>

After installing, and enabling mod, I start the game, and there is no effect on where a settler may build a city. I have confirmed the files are in the right location and other (i.e., downloaded) mods work fine.

Any suggestions would be much appreciated.
 
You can't put multiple Set/Where entries within a single Update. Or more specifically, if you do, then the game treats them as an inherent AND. That's just fine for the Set part, but it screws up your Where. So since a terrain type can't be grass AND plains AND desert AND snow at the same time, no entries in the database get modified. To disable the founding on multiple terrain types, you have to do it like so:

Code:
<GameData>
  <Terrains>
    <Update>
      <Set Found="false"/>
      <Where Type="TERRAIN_GRASS"/>
    </Update>
    <Update>
      <Set Found="false"/>
      <Where Type="TERRAIN_PLAINS"/>
    </Update>
    <Update>
      <Set Found="false"/>
      <Where Type="TERRAIN_DESERT"/>
    </Update>
    <Update>
      <Set Found="false"/>
      <Where Type="TERRAIN_SNOW"/>
    </Update>
  </Terrains>
</GameData>

Edit:
Also, something's seriously wrong with the modinfo file. You've got CityTerrains.xml in the OnModActivated command, but it's not also listed in the <Files> section.

I should also point out that if you prohibit settling on anything other than Tundra, the game will break horribly on anything other than an all-tundra map, although given that you're adding a map file as part of the mod I'll assume that you've got that covered. Just understand that the AI might not handle this well, since it only searches a small area around the Settler's location for suitable sites, at least until later eras when it switches to a more complex algorithm.
 
Holy crap, you rock! Fixed the syntax, and added the file the correct way (I thought it was supposed to be done thru the content tab in the properties window). Now it works!

Thanks for all of your help today.
 
Back
Top Bottom