Forest Replanting Mod

And today's stupid mofo award goes to .... me!
:suicide:

Looks like I managed to pull off one huge copy-paste error in the last release.
BIG apologies to buffy66 and thanks for pointing this out to me.
Also, thanks to snarko for suggesting the use of getInfoTypeForString.
Your corrected python still misses the code to remove the actual Nursery Improvement. Fixed this and re-uploaded.
I'm really embarrassed. Might have noticed this earlier if I had actually played CIV for more than an hour in the last week. Somebody email me some hours of time. :(
_____
rezaf
 
Btw, if you make the Tree Nursery increase production output of plot by +1(like the Forest will) then AI will actually build these also.
 
Yeah, getting the AI to use it might be a problem.
I do like the orchard idea and it could be used to address an abuse problem. fall it in the middle. 15 turns to build an orchard, 15 turns worked to turn it into a forest. Orchards can NOT be cleared. Multiple workers could then hurry up the planting a bit, but the tile has to be worked for it to mature to a tile that can be harvested.
 
rezaf said:
And today's stupid mofo award goes to .... me!
:suicide:

Looks like I managed to pull off one huge copy-paste error in the last release.
_____
rezaf

I too missed the build forest feature, this mod is an excellent idea.

Having read all of these posts I am confused as to what the correct mod is now?

To make it clear (to someone who has never done a mod before), could you re-print it and tell anyone who doesnt know, where to put it,

Many Thanks, :D

Nik

P.S. Is there a way add a check box in the options to stop automated workers from chopping down forests!!?
 
Concidering the season, can you add an additional nursery that makes a christmas tree farm? It would add happiness instead of production :)
 
In fact, reforestation doesn't really do you that much good, and with the 25 turn delay in place before you could go ahead and chop the forest down, I don't think it does much good, either. It's more of an aesthetical thing, except the health bonus it will give you once you get environmentalism.

The advantage of replanting forests is that a lumbermilled forest has the same production as a workshop, without the food or health penalties, and +0.4 health instead. Another way to look at it is that it's 1 hammer less than a mined hill, in trade for +1 food and a health bonus, that can be on normal grassland or plains. :)

In order to get the AI to build them, just give the base improment a +1 hammer bonus, and last only one turn before it upgrades. This "zeroth" level would be called the same, so the difference between it and the first level would be pretty much invisible to the player. The levels could be: Worker job (15 turns), then "Nursery" (1 turn, +1 hammer) -> "Nursery" (4 turns) -> "Orchard" (10 turns) -> Forest. Or, you could give all the levels a flat +1 hammer bonus, giving you something for the 15 turns until it matures. Once it's a full-grown forest, you can then add the lumbermill and railroad to improve the production of the tile up to normal standards.


Why not make tree replanting a benefit of Environmentalism? I don't think organized replanting of trees really evolved to the scale it is today until conservation concerns began to come to light in the modern era. If Environmentalism let you replant forests, in addition to the health and happiness bonuses, that would make it a stupendous civic for boosting city size and production capabilities at endgame (in trade for economic income, which you generally no longer need). This was likely the intention the designers had in mind when creating that civic :)
 
I understand your reasons for doing the tree nursery and don't disagree, but if you are worried about people abusing the sheild bonus for chopping it down after replanting can't you make it so workers don't plant forests but a new terrain improvment call "planted forests" and then give it all the benefits of a forest but take away the shield bonus for chopping it down? Or at least lower it?
Not sure if this can be done since I don't mod but I thought I'd suggest it.
 
How do you combine two different mods into one game? Just putting all the folders in the same mod?
 
This is a great mod, but a nice little readme.txt file to explain where the changes are for modders, would be nice. Thanks for putting this together.
 
i got it to work :D i really like this mod since it doesnt change the dll you can fold into any other mod. huge thanks to rezaf for creating it!:goodjob:

the only wierd thing i noticed was that if a city begins working a nursery plot, then stops, the 'turns until forest' text doesnt change back to 'city must work' message...no biggie.

anyway, here's what i did:

Spoiler :


start with bts 3.17 files or compatible files from another mod.

CIV4UnitInfos.xml : add this to the two worker units
Code:
<Build>
<BuildType>BUILD_TREE_NURSERY</BuildType>
<bBuild>1</bBuild>
 </Build>
CIV4BuildInfos.xml: add this
Code:
<BuildInfo>
			<Type>BUILD_TREE_NURSERY</Type>
			<Description>TXT_KEY_BUILD_TREE_NURSERY</Description>
			<Help/>
			<PrereqTech>TECH_GUILDS</PrereqTech>
			<iTime>500</iTime>
                        <iCost>0</iCost>
			<bKill>0</bKill>
			<ImprovementType>IMPROVEMENT_TREE_NURSERY</ImprovementType>
			<RouteType>NONE</RouteType>
			<EntityEvent>ENTITY_EVENT_BUILD</EntityEvent>
			<FeatureStructs/>
			<HotKey>KB_S</HotKey>
			<bAltDown>0</bAltDown>
			<bShiftDown>1</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>1</iHotKeyPriority>
			<Button>,Art/Interface/Buttons/TerrainFeatures/Forest.dds,Art/Interface/Buttons/BaseTerrain_TerrainFeatures_Atlas.dds,3,3</Button>
		</BuildInfo>
TEXT files: no change

CIV4ImprovementInfos.xml: use bts 3.17, add
Code:
<ImprovementInfo>
			<Type>IMPROVEMENT_TREE_NURSERY</Type>
			<Description>TXT_KEY_IMPROVEMENT_TREE_NURSERY</Description>
			<Civilopedia>TXT_KEY_IMPROVEMENT_TREE_NURSERY_PEDIA</Civilopedia>
			<ArtDefineTag>ART_DEF_IMPROVEMENT_PLANTATION</ArtDefineTag>
			<PrereqNatureYields/>
			<YieldChanges/>
<bActsAsCity>0</bActsAsCity>
			<bHillsMakesValid>0</bHillsMakesValid>
			<bFreshWaterMakesValid>0</bFreshWaterMakesValid>
			<bRiverSideMakesValid>0</bRiverSideMakesValid>
			<bNoFreshWater>0</bNoFreshWater>
			<bRequiresFlatlands>0</bRequiresFlatlands>
			<bRequiresRiverSide>0</bRequiresRiverSide>
			<bRequiresIrrigation>0</bRequiresIrrigation>
			<bCarriesIrrigation>0</bCarriesIrrigation>
			<bRequiresFeature>0</bRequiresFeature>
			<bWater>0</bWater>
			<bGoody>0</bGoody>
			<bPermanent>0</bPermanent>
			<bUseLSystem>1</bUseLSystem>
<iAdvancedStartCost>48</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
			<iTilesPerGoody>0</iTilesPerGoody>
			<iGoodyRange>0</iGoodyRange>
<iFeatureGrowth>0</iFeatureGrowth>
			<iUpgradeTime>25</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>
				<TerrainMakesValid>
					<TerrainType>TERRAIN_TUNDRA</TerrainType>
					<bMakesValid>1</bMakesValid>
				</TerrainMakesValid>
			</TerrainMakesValids>
			<FeatureMakesValids/>
			<ImprovementPillage/>
			<ImprovementUpgrade>IMPROVEMENT_TREE_NURSERY_II</ImprovementUpgrade>
			<TechYieldChanges/>
			<RouteYieldChanges/>
			<bGraphicalOnly>0</bGraphicalOnly>
		</ImprovementInfo>
		<ImprovementInfo>
			<Type>IMPROVEMENT_TREE_NURSERY_II</Type>
			<Description>TXT_KEY_FEATURE_FOREST</Description>
			<Civilopedia>TXT_KEY_IMPROVEMENT_TREE_NURSERY_PEDIA</Civilopedia>
			<ArtDefineTag>ART_DEF_IMPROVEMENT_PLANTATION</ArtDefineTag>
			<PrereqNatureYields/>
			<YieldChanges/>
<bActsAsCity>0</bActsAsCity>
			<bHillsMakesValid>0</bHillsMakesValid>
			<bFreshWaterMakesValid>0</bFreshWaterMakesValid>
			<bRiverSideMakesValid>0</bRiverSideMakesValid>
			<bNoFreshWater>0</bNoFreshWater>
			<bRequiresFlatlands>0</bRequiresFlatlands>
			<bRequiresRiverSide>0</bRequiresRiverSide>
			<bRequiresIrrigation>0</bRequiresIrrigation>
			<bCarriesIrrigation>0</bCarriesIrrigation>
			<bRequiresFeature>0</bRequiresFeature>
			<bWater>0</bWater>
			<bGoody>0</bGoody>
			<bPermanent>0</bPermanent>
			<bUseLSystem>1</bUseLSystem>
<iAdvancedStartCost>48</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
			<iTilesPerGoody>0</iTilesPerGoody>
			<iGoodyRange>0</iGoodyRange>
<iFeatureGrowth>0</iFeatureGrowth>
			<iUpgradeTime>5</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>
				<TerrainMakesValid>
					<TerrainType>TERRAIN_TUNDRA</TerrainType>
					<bMakesValid>1</bMakesValid>
				</TerrainMakesValid>
			</TerrainMakesValids>
			<FeatureMakesValids/>
			<ImprovementPillage/>
			<ImprovementUpgrade/>
			<TechYieldChanges/>
			<RouteYieldChanges/>
			<bGraphicalOnly>0</bGraphicalOnly>
		</ImprovementInfo>

CvEventManager.py: replace def onImprovementBuilt section with
Code:
def onImprovementBuilt(self, argsList):
		'Improvement Built'
		iImprovement, iX, iY = argsList
		pPlot = CyMap().plot(iX,iY)
		if(iImprovement==gc.getInfoTypeForString('IMPROVEMENT_TREE_NURSERY_II')):
			CyInterface().addMessage(CyGame().getActivePlayer(),True,25,'A tree nursery has matured into a Forest!','AS2D_DISCOVERBONUS',1,'Art/Interface/Buttons/TerrainFeatures/Forest.dds',ColorTypes(8),iX,iY,True,True)
			pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_FOREST'), 0)
			pPlot.setImprovementType(-1)
		if (not self.__LOG_IMPROVEMENT):
			return
		CvUtil.pyPrint('Improvement %s was built at %d, %d'
			%(PyInfo.ImprovementInfo(iImprovement).getDescription(), iX, iY))
 
I can't play this mod with BTS 3.17
Anyone can upload new forestry mod file that can play with BTS 3.17?
Thanks.
 
Back
Top Bottom