Need help removing Petra's bonus from Desert Hills

clamlol

Chieftain
Joined
Feb 10, 2022
Messages
3
Hey y'all, I'm new to Civ V modding and was hoping to make a small mod to iron out a few pet peeves of mine. Only thing I'm thing I'm really stuck on rn is figuring out how to remove Petra's bonus from desert hills. I put the following in my Buildings.xml:
Code:
<GameData>   
  <Building_TerrainYieldChanges>
    <Delete BuildingType="BUILDING_PETRA"/>
      <!-- Was in Civ5_Buildings_Inherited_Expansion2 -->
      <Row>
        <BuildingType>BUILDING_PETRA</BuildingType>
        <TerrainType>TERRAIN_DESERT</TerrainType>
        <YieldType>YIELD_FOOD</YieldType>
        <Yield>1</Yield>
      </Row>
      <Row>
        <BuildingType>BUILDING_PETRA</BuildingType>
        <TerrainType>TERRAIN_DESERT</TerrainType>
        <YieldType>YIELD_PRODUCTION</YieldType>
        <Yield>1</Yield>
      </Row>
      <!-- My changes -->
      <Row>
        <BuildingType>BUILDING_PETRA</BuildingType>
        <TerrainType>TERRAIN_DESERT,TERRAIN_HILL</TerrainType>
        <YieldType>YIELD_FOOD</YieldType>
        <Yield>-1</Yield>
      </Row>
      <Row>
        <BuildingType>BUILDING_PETRA</BuildingType>
        <TerrainType>TERRAIN_DESERT,TERRAIN_HILL</TerrainType>
        <YieldType>YIELD_PRODUCTION</YieldType>
        <Yield>-1</Yield>
      </Row>
  </Building_TerrainYieldChanges>
</GameData>
but it doesn't seem to affect anything. If anyone is able to help I would greatly appreciate it.
 

TheOneHitPupper

Chieftain
Joined
Jun 15, 2017
Messages
97
Deserts and Hills are treated as seperate TerrainTypes, so by modifying that, you'll have to disable the bonus on all hills and all deserts independently.

The changes you made are broken, probably resulting in the entire file being rejected. You can't have more than one reference in XML, so where you have <TerrainType>, put only one TerrainType and just duplicate it for the second.

Your code should look something like this:

Code:
<GameData>
  <Building_TerrainYieldChanges>
    <Delete BuildingType="BUILDING_PETRA"/>
      <!-- My changes -->
      <Row>
        <BuildingType>BUILDING_PETRA</BuildingType>
        <TerrainType>TERRAIN_DESERT</TerrainType>
        <YieldType>YIELD_FOOD</YieldType>
        <Yield>-1</Yield>
      </Row>
      <Row>
        <BuildingType>BUILDING_PETRA</BuildingType>
        <TerrainType>TERRAIN_HILL</TerrainType>
        <YieldType>YIELD_FOOD</YieldType>
        <Yield>-1</Yield>
      </Row>
 
Last edited:

clamlol

Chieftain
Joined
Feb 10, 2022
Messages
3
Hi, sorry for the delayed reply. I'm a bit confused by your suggestion; wouldn't that end up removing 1 food from ALL desert tiles and 1 production from ALL hill tiles?
 

TheOneHitPupper

Chieftain
Joined
Jun 15, 2017
Messages
97
Hi, sorry for the delayed reply. I'm a bit confused by your suggestion; wouldn't that end up removing 1 food from ALL desert tiles and 1 production from ALL hill tiles?
Yes afaik, there's not a way to specify multiple TerrainTypes like the way you want with XML/SQL. You'd need LUA.
 

clamlol

Chieftain
Joined
Feb 10, 2022
Messages
3
Got it, that's a bit beyond what I'm willing to delve into but at least now I know where to start if I pick this project up again. Thanks for the help!
 
Top Bottom