REQUEST: Simple Plant Forest Mod

It's hard to be sure why that would happen, but there is one possibility that comes immediately to mind.

In Python, the white space matters. That is, the "empty" space at the beginning of each line is important. The Python code that comes with Civ uses tabs to indent, so you should use tabs too. If whatever program you use to edit the files is changing tabs to spaces, make it stop.

THANK YOU VERY MUCH!!!!!!

That was it!


Edit: I will add some thanks to you in the files!
 
Ok here's the next one.

I know how to make an Improvement always buildable for a feature (FeatureMakesValid),

But how can I do the opposite?
I want to make the "Build Forest" Option NOT available on Forest/Jungle Plots.

Anyone an idea?
 
If you look at the Units\Civ4BuildInfos.xml, you can see, how it's done that chopping forest needs bronze working, right?
Now do the same for forest planting, but use future tech instead.
This will "allow" you only to plant forests in forest when you have future tech -> so never ever.
 
Ok. It's a good Workaround, but what is necessary to prevent the button from showing up?

That's C++ stuff I guess.
 
If nobody else has an amazing idea for the problem mentioned above,
I'd say we move on to (maybe) the last point:

What should the 3 improvements cost in time, money and tech?

Plant Tree: 5 rounds, 25 gold, BIOLOGY
Hill up/down: 10 rounds, 100 gold, PLASTIC
Terraform: 20 rounds, 500 gold, GENETICS (since Future Tech won't work)

Oh, BTW: Should "Plant Forest" be able on Jungle Terrain?
I guess so, since you could always chop the jungle down first, so why making it two steps?
On the other hand, "Plant Forest" is about preserving forests, chopping down jungles to plant forests...?
Does this sound weird only to me?
 
seems i found this thread a little late. I had adapted a "forestry mod" and tweaked it, and its been part of my expanded plus mod for some time.

the way it works is that you build the improvement "tree nursery" -> there is a one turn conversion to a "young forest" which triggers a python conversion to a forest.
my code, XML:
Spoiler :

<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>
<iYieldChange>0</iYieldChange>
<iYieldChange>1</iYieldChange>
<iYieldChange>0</iYieldChange>
</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>10</iUpgradeTime>
<iAirBombDefense>5</iAirBombDefense>
<iDefenseModifier>0</iDefenseModifier>
<iHappiness>1</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_YOUNG_FOREST</ImprovementUpgrade>
<TechYieldChanges/>
<RouteYieldChanges/>
<bGraphicalOnly>0</bGraphicalOnly>
</ImprovementInfo>
<ImprovementInfo>
<Type>IMPROVEMENT_YOUNG_FOREST</Type>
<Description>TXT_KEY_IMPROVEMENT_YOUNG_FOREST</Description>
<Civilopedia>TXT_KEY_IMPROVEMENT_YOUNG_FOREST_PEDIA</Civilopedia>
<ArtDefineTag>ART_DEF_FEATURE_FOREST</ArtDefineTag>
<PrereqNatureYields/>
<YieldChanges>
<iYieldChange>0</iYieldChange>
<iYieldChange>1</iYieldChange>
<iYieldChange>0</iYieldChange>
</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>0</iUpgradeTime>
<iAirBombDefense>5</iAirBombDefense>
<iDefenseModifier>0</iDefenseModifier>
<iHappiness>1</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>


you can see i added happiness to a tree nursery to give the AI a reason to build tree nurseries...its not too far from the truth that the populace would like reforestation.

python:
Spoiler :

def onImprovementBuilt(self, argsList):
'Improvement Built'
iImprovement, iX, iY = argsList
pPlot = CyMap().plot(iX,iY)
iowner = pPlot.getOwner()

if(iImprovement==gc.getInfoTypeForString('IMPROVEMENT_YOUNG_FOREST')):
if (iowner==CyGame().getActivePlayer()):
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))


to prevent building on an existing forest you could python check for an existing forest ahead of time.

anyway, i dont know if anyof that helps, it seems you guys got a mod working.:goodjob:

props to the original author:
http://forums.civfanatics.com/showthread.php?t=138242
 
No thanks we are fine.
The mod works real nice and the python code is very simple.
No need for maturing stuff etc.

There are but 2 things left:

1) Define cost in money and time, and tech_prereq

2) Well, that's sort of weird:

I recently realized, that a worker can only have a maximum of 22 (or so) Build Commands.
Any additional will just not be shown in the game and cannot be used (neither via Hotkey).

Problem: The basic worker already got 20 commands, so only 2 places are free to use.

But this mod includes 3! (Forest, Hill, Terraform)

So to use all three, one older build thingy must go.

I think, I will merge the Winery into the Plantation. They are thematically and statistically almost the same so no big lost.


Please comment on the 2 points!
 
Back
Top Bottom