I found my problem... it's the PrereqNatureYields tag. If you have 1, 0, 0, it means anything with at least 1 food is possible to build the improvement on, even if TerrainMakesValid doesn't have the specified land types. And there is no way to specify if a land/feature should NOT have the improvement. For example, my desert farms should not be buildable on Desert FloodPlains, only on Desert. The farm improvement doesn't have "TERRAIN_DESERT" in the makesvalid tag.
------
Hello, I'd like to know how to change my mod so I can build a farm in the desert. I made a desert windmill without any problems, I checked how it was made in GreenMod. I decided I'd make a new improvement (Desert Farm) so I could add different bonuses to it depending on tech...
The problems: The Desert Farm is buildable on grasslands/plains. I can't build it in the desert tiles.
Civ4ImprovementInfos.xml
I added the TerrainMakesValid 0 to plains/grasslands since I have no idea how to disable building desert farm on grasslands/plains. It doesn't work.
Civ4BuildInfos.xml
I could remove the forest/jungle thing but it doesn't really matter at this point.
Civ4UnitInfos.xml
I only added this part to the workers.
This is what I've done. The Desert Windmill is working fine, but the Desert Farm just isn't. If you have any idea how to make it work, let me know! Maybe it requires work in the SDK?
------
Hello, I'd like to know how to change my mod so I can build a farm in the desert. I made a desert windmill without any problems, I checked how it was made in GreenMod. I decided I'd make a new improvement (Desert Farm) so I could add different bonuses to it depending on tech...
The problems: The Desert Farm is buildable on grasslands/plains. I can't build it in the desert tiles.
Civ4ImprovementInfos.xml
Spoiler :
<ImprovementInfo>
<Type>IMPROVEMENT_DESERT_FARM</Type>
<Description>Desert Farm</Description>
<Civilopedia>TXT_KEY_IMPROVEMENT_FARM_PEDIA</Civilopedia>
<ArtDefineTag>ART_DEF_IMPROVEMENT_FARM</ArtDefineTag>
<PrereqNatureYields>
<iYield>1</iYield>
<iYield>0</iYield>
<iYield>0</iYield>
</PrereqNatureYields>
<IrrigatedYieldChange>
<iYield>1</iYield>
<iYield>0</iYield>
<iYield>0</iYield>
</IrrigatedYieldChange>
<bActsAsCity>0</bActsAsCity>
<bHillsMakesValid>0</bHillsMakesValid>
<bFreshWaterMakesValid>1</bFreshWaterMakesValid>
<bRiverSideMakesValid>0</bRiverSideMakesValid>
<bNoFreshWater>0</bNoFreshWater>
<bRequiresFlatlands>1</bRequiresFlatlands>
<bRequiresRiverSide>0</bRequiresRiverSide>
<bRequiresIrrigation>1</bRequiresIrrigation>
<bCarriesIrrigation>1</bCarriesIrrigation>
<bRequiresFeature>0</bRequiresFeature>
<bWater>0</bWater>
<bGoody>0</bGoody>
<bPermanent>0</bPermanent>
<bUseLSystem>1</bUseLSystem>
<iTilesPerGoody>0</iTilesPerGoody>
<iGoodyRange>0</iGoodyRange>
<iUpgradeTime>0</iUpgradeTime>
<iAirBombDefense>5</iAirBombDefense>
<iDefenseModifier>0</iDefenseModifier>
<iPillageGold>5</iPillageGold>
<TerrainMakesValids>
<TerrainMakesValid>
<TerrainType>TERRAIN_GRASS</TerrainType>
<bMakesValid>0</bMakesValid>
</TerrainMakesValid>
<TerrainMakesValid>
<TerrainType>TERRAIN_PLAINS</TerrainType>
<bMakesValid>0</bMakesValid>
</TerrainMakesValid>
<TerrainMakesValid>
<TerrainType>TERRAIN_DESERT</TerrainType>
<bMakesValid>1</bMakesValid>
</TerrainMakesValid>
</TerrainMakesValids>
<FeatureMakesValids/>
<ImprovementPillage/>
<ImprovementUpgrade/>
<TechYieldChanges>
<TechYieldChange>
<PrereqTech>TECH_MACHINERY</PrereqTech>
<TechYields>
<iYield>1</iYield>
<iYield>0</iYield>
<iYield>0</iYield>
</TechYields>
</TechYieldChange>
</TechYieldChanges>
<RouteYieldChanges/>
<bGraphicalOnly>0</bGraphicalOnly>
</ImprovementInfo>
<Type>IMPROVEMENT_DESERT_FARM</Type>
<Description>Desert Farm</Description>
<Civilopedia>TXT_KEY_IMPROVEMENT_FARM_PEDIA</Civilopedia>
<ArtDefineTag>ART_DEF_IMPROVEMENT_FARM</ArtDefineTag>
<PrereqNatureYields>
<iYield>1</iYield>
<iYield>0</iYield>
<iYield>0</iYield>
</PrereqNatureYields>
<IrrigatedYieldChange>
<iYield>1</iYield>
<iYield>0</iYield>
<iYield>0</iYield>
</IrrigatedYieldChange>
<bActsAsCity>0</bActsAsCity>
<bHillsMakesValid>0</bHillsMakesValid>
<bFreshWaterMakesValid>1</bFreshWaterMakesValid>
<bRiverSideMakesValid>0</bRiverSideMakesValid>
<bNoFreshWater>0</bNoFreshWater>
<bRequiresFlatlands>1</bRequiresFlatlands>
<bRequiresRiverSide>0</bRequiresRiverSide>
<bRequiresIrrigation>1</bRequiresIrrigation>
<bCarriesIrrigation>1</bCarriesIrrigation>
<bRequiresFeature>0</bRequiresFeature>
<bWater>0</bWater>
<bGoody>0</bGoody>
<bPermanent>0</bPermanent>
<bUseLSystem>1</bUseLSystem>
<iTilesPerGoody>0</iTilesPerGoody>
<iGoodyRange>0</iGoodyRange>
<iUpgradeTime>0</iUpgradeTime>
<iAirBombDefense>5</iAirBombDefense>
<iDefenseModifier>0</iDefenseModifier>
<iPillageGold>5</iPillageGold>
<TerrainMakesValids>
<TerrainMakesValid>
<TerrainType>TERRAIN_GRASS</TerrainType>
<bMakesValid>0</bMakesValid>
</TerrainMakesValid>
<TerrainMakesValid>
<TerrainType>TERRAIN_PLAINS</TerrainType>
<bMakesValid>0</bMakesValid>
</TerrainMakesValid>
<TerrainMakesValid>
<TerrainType>TERRAIN_DESERT</TerrainType>
<bMakesValid>1</bMakesValid>
</TerrainMakesValid>
</TerrainMakesValids>
<FeatureMakesValids/>
<ImprovementPillage/>
<ImprovementUpgrade/>
<TechYieldChanges>
<TechYieldChange>
<PrereqTech>TECH_MACHINERY</PrereqTech>
<TechYields>
<iYield>1</iYield>
<iYield>0</iYield>
<iYield>0</iYield>
</TechYields>
</TechYieldChange>
</TechYieldChanges>
<RouteYieldChanges/>
<bGraphicalOnly>0</bGraphicalOnly>
</ImprovementInfo>
I added the TerrainMakesValid 0 to plains/grasslands since I have no idea how to disable building desert farm on grasslands/plains. It doesn't work.
Civ4BuildInfos.xml
Spoiler :
<BuildInfo>
<Type>BUILD_DESERT_FARM</Type>
<Description>Build a [LINK=IMPROVEMENT_DESERT_FARM]Desert Farm[\LINK]</Description>
<Help/>
<PrereqTech>TECH_AGRICULTURE</PrereqTech>
<iTime>800</iTime>
<bKill>0</bKill>
<ImprovementType>IMPROVEMENT_DESERT_FARM</ImprovementType>
<RouteType>NONE</RouteType>
<EntityEvent>ENTITY_EVENT_IRRIGATE</EntityEvent>
<FeatureStructs>
<FeatureStruct>
<FeatureType>FEATURE_JUNGLE</FeatureType>
<PrereqTech>TECH_IRON_WORKING</PrereqTech>
<iTime>400</iTime>
<iProduction>0</iProduction>
<bRemove>1</bRemove>
</FeatureStruct>
<FeatureStruct>
<FeatureType>FEATURE_FOREST</FeatureType>
<PrereqTech>TECH_BRONZE_WORKING</PrereqTech>
<iTime>300</iTime>
<iProduction>30</iProduction>
<bRemove>1</bRemove>
</FeatureStruct>
</FeatureStructs>
<HotKey>KB_I</HotKey>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Interface/Buttons/Builds/BuildFarm.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,3,7</Button>
</BuildInfo>
<Type>BUILD_DESERT_FARM</Type>
<Description>Build a [LINK=IMPROVEMENT_DESERT_FARM]Desert Farm[\LINK]</Description>
<Help/>
<PrereqTech>TECH_AGRICULTURE</PrereqTech>
<iTime>800</iTime>
<bKill>0</bKill>
<ImprovementType>IMPROVEMENT_DESERT_FARM</ImprovementType>
<RouteType>NONE</RouteType>
<EntityEvent>ENTITY_EVENT_IRRIGATE</EntityEvent>
<FeatureStructs>
<FeatureStruct>
<FeatureType>FEATURE_JUNGLE</FeatureType>
<PrereqTech>TECH_IRON_WORKING</PrereqTech>
<iTime>400</iTime>
<iProduction>0</iProduction>
<bRemove>1</bRemove>
</FeatureStruct>
<FeatureStruct>
<FeatureType>FEATURE_FOREST</FeatureType>
<PrereqTech>TECH_BRONZE_WORKING</PrereqTech>
<iTime>300</iTime>
<iProduction>30</iProduction>
<bRemove>1</bRemove>
</FeatureStruct>
</FeatureStructs>
<HotKey>KB_I</HotKey>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Interface/Buttons/Builds/BuildFarm.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,3,7</Button>
</BuildInfo>
I could remove the forest/jungle thing but it doesn't really matter at this point.
Civ4UnitInfos.xml
Spoiler :
<Build>
<BuildType>BUILD_DESERT_FARM</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_DESERT_WINDMILL</BuildType>
<bBuild>1</bBuild>
</Build>
<BuildType>BUILD_DESERT_FARM</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_DESERT_WINDMILL</BuildType>
<bBuild>1</bBuild>
</Build>
I only added this part to the workers.
This is what I've done. The Desert Windmill is working fine, but the Desert Farm just isn't. If you have any idea how to make it work, let me know! Maybe it requires work in the SDK?