[BTS Mod Component] Farms

Gurra09

Emperor
Joined
Jan 1, 2008
Messages
1,302
Location
Sweden
This is a small XML Mod Component that gives farms a small chance of discovering Corn, Rice or Wheat.

Download!

XML Changes:
Spoiler :
Original Farm Code:
Code:
<ImprovementInfo>
			<Type>IMPROVEMENT_FARM</Type>
			<Description>TXT_KEY_IMPROVEMENT_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>
			<iAdvancedStartCost>30</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
			<iTilesPerGoody>0</iTilesPerGoody>
			<iGoodyRange>0</iGoodyRange>
			<iFeatureGrowth>0</iFeatureGrowth>
			<iUpgradeTime>0</iUpgradeTime>
			<iAirBombDefense>5</iAirBombDefense>
			<iDefenseModifier>0</iDefenseModifier>
			<iHappiness>0</iHappiness>
			<iPillageGold>5</iPillageGold>
			<bOutsideBorders>0</bOutsideBorders>
			<TerrainMakesValids>
				<TerrainMakesValid>
					<TerrainType>TERRAIN_GRASS</TerrainType>
					<bMakesValid>1</bMakesValid>
				</TerrainMakesValid>
				<TerrainMakesValid>
					<TerrainType>TERRAIN_PLAINS</TerrainType>
					<bMakesValid>1</bMakesValid>
				</TerrainMakesValid>
			</TerrainMakesValids>
			<FeatureMakesValids/>
			<BonusTypeStructs>
				<BonusTypeStruct>
					<BonusType>BONUS_CORN</BonusType>
					<bBonusMakesValid>1</bBonusMakesValid>
					<bBonusTrade>1</bBonusTrade>
					<iDiscoverRand>0</iDiscoverRand>
					<YieldChanges>
						<iYieldChange>2</iYieldChange>
						<iYieldChange>0</iYieldChange>
						<iYieldChange>0</iYieldChange>
					</YieldChanges>
				</BonusTypeStruct>
				<BonusTypeStruct>
					<BonusType>BONUS_RICE</BonusType>
					<bBonusMakesValid>1</bBonusMakesValid>
					<bBonusTrade>1</bBonusTrade>
					<iDiscoverRand>0</iDiscoverRand>
					<YieldChanges>
						<iYieldChange>1</iYieldChange>
						<iYieldChange>0</iYieldChange>
						<iYieldChange>0</iYieldChange>
					</YieldChanges>
				</BonusTypeStruct>
				<BonusTypeStruct>
					<BonusType>BONUS_WHEAT</BonusType>
					<bBonusMakesValid>1</bBonusMakesValid>
					<bBonusTrade>1</bBonusTrade>
					<iDiscoverRand>0</iDiscoverRand>
					<YieldChanges>
						<iYieldChange>2</iYieldChange>
						<iYieldChange>0</iYieldChange>
						<iYieldChange>0</iYieldChange>
					</YieldChanges>
				</BonusTypeStruct>
			</BonusTypeStructs>
			<ImprovementPillage/>
			<ImprovementUpgrade/>
			<TechYieldChanges>
				<TechYieldChange>
					<PrereqTech>TECH_BIOLOGY</PrereqTech>
					<TechYields>
						<iYield>1</iYield>
						<iYield>0</iYield>
						<iYield>0</iYield>
					</TechYields>
				</TechYieldChange>
			</TechYieldChanges>
			<RouteYieldChanges/>
			<bGraphicalOnly>0</bGraphicalOnly>
		</ImprovementInfo>

Edited Farm Code:
Code:
<ImprovementInfo>
			<Type>IMPROVEMENT_FARM</Type>
			<Description>TXT_KEY_IMPROVEMENT_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>
			<iAdvancedStartCost>30</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
			<iTilesPerGoody>0</iTilesPerGoody>
			<iGoodyRange>0</iGoodyRange>
			<iFeatureGrowth>0</iFeatureGrowth>
			<iUpgradeTime>0</iUpgradeTime>
			<iAirBombDefense>5</iAirBombDefense>
			<iDefenseModifier>0</iDefenseModifier>
			<iHappiness>0</iHappiness>
			<iPillageGold>5</iPillageGold>
			<bOutsideBorders>0</bOutsideBorders>
			<TerrainMakesValids>
				<TerrainMakesValid>
					<TerrainType>TERRAIN_GRASS</TerrainType>
					<bMakesValid>1</bMakesValid>
				</TerrainMakesValid>
				<TerrainMakesValid>
					<TerrainType>TERRAIN_PLAINS</TerrainType>
					<bMakesValid>1</bMakesValid>
				</TerrainMakesValid>
			</TerrainMakesValids>
			<FeatureMakesValids/>
			<BonusTypeStructs>
				<BonusTypeStruct>
					<BonusType>BONUS_CORN</BonusType>
					<bBonusMakesValid>1</bBonusMakesValid>
					<bBonusTrade>1</bBonusTrade>
					<!-- Farms Mod Component Changes Start -->
					<iDiscoverRand>10000</iDiscoverRand>
					<!-- Farms Mod Component Changes End -->
					<YieldChanges>
						<iYieldChange>2</iYieldChange>
						<iYieldChange>0</iYieldChange>
						<iYieldChange>0</iYieldChange>
					</YieldChanges>
				</BonusTypeStruct>
				<BonusTypeStruct>
					<BonusType>BONUS_RICE</BonusType>
					<bBonusMakesValid>1</bBonusMakesValid>
					<bBonusTrade>1</bBonusTrade>
					<!-- Farms Mod Component Changes Start -->
					<iDiscoverRand>10000</iDiscoverRand>
					<!-- Farms Mod Component Changes End -->
					<YieldChanges>
						<iYieldChange>1</iYieldChange>
						<iYieldChange>0</iYieldChange>
						<iYieldChange>0</iYieldChange>
					</YieldChanges>
				</BonusTypeStruct>
				<BonusTypeStruct>
					<BonusType>BONUS_WHEAT</BonusType>
					<bBonusMakesValid>1</bBonusMakesValid>
					<bBonusTrade>1</bBonusTrade>
					<!-- Farms Mod Component Changes Start -->
					<iDiscoverRand>10000</iDiscoverRand>
					<!-- Farms Mod Component Changes End -->
					<YieldChanges>
						<iYieldChange>2</iYieldChange>
						<iYieldChange>0</iYieldChange>
						<iYieldChange>0</iYieldChange>
					</YieldChanges>
				</BonusTypeStruct>
			</BonusTypeStructs>
			<ImprovementPillage/>
			<ImprovementUpgrade/>
			<TechYieldChanges>
				<TechYieldChange>
					<PrereqTech>TECH_BIOLOGY</PrereqTech>
					<TechYields>
						<iYield>1</iYield>
						<iYield>0</iYield>
						<iYield>0</iYield>
					</TechYields>
				</TechYieldChange>
			</TechYieldChanges>
			<RouteYieldChanges/>
			<bGraphicalOnly>0</bGraphicalOnly>
		</ImprovementInfo>
 
This is cool. I waner why no one has comented on it yet.
:clap::goodjob::clap:
 
This looks like a really cool mod! I'm thinking about doing a worker-related mod and this would fit in well. It's an excellent idea, too. The random mine finds are fun, and this would be fun in the same way. :)

I'm very new to modding Civ IV, so could someone tell me how much of a chance there is of discovering a resource? I'm not sure what the "10000" really means.
 
Nice mod tho it hardly merits a download. Just copy'n'paste the single line of xml in the apporpriate places.

<iDiscoverRand>10000</iDiscoverRand>
 
I've experimented with this line. The lower the value the higher the chance of the bonus appearing. Set it to 1 and the bonus appears, but only as soon as the improvement is worked (which is relevant because if you make an imp to use this expecting the AI to use it you had better give it some kind of yield value in addition or it won't get used). If you do this for multiple bonus, it will always produce the first bonus in the list, ie if you have corn, wheat and rice then corn will always appear. If you set the value to 10000 the stuff almost never appears. For my future mod there is an advanced tech improvement called the Domefarm that structs all animal and plant bonuses and has a 1000 in this value for all of them. Basically once you build a bunch of these, this stuff starts sprouting everywhere but at 1000 it's pretty random which one, and it isn't instant, except that if you have a lot of them throughout your empire you get one every few turns somewhere. Which should be OK balance wise, since there are so many bonus types and since I have Minor Annoyances global warming and Tsentom's Andromeda weapon to destroy bonuses.
 
Back
Top Bottom