Basic Forestry (mod comp)

modifieda4

Chief Time Waster
Joined
Sep 3, 2006
Messages
385
Location
Gold Coast
Basic Forestry by ModifiedA4 v1.1 12/28/2012

The Forestry mod comp creates a new improvement for workers to build, the tree nursery. The tree nursery, when worked on a city plot, matures to a forest.

Download here

change log:
Spoiler :

  • 1.0 initial release
  • 1.1 added latitude and terrain dependant forest graphics, and 40% chance for jungles in equatorial zones


Requirements:
  • BTS 3.19
  • BUG 4.4 (installed as a standalone mod)
  • Gamecore DLL independant

see readme.txt for installation instructions.

Features:
  • adds a new improvement, the tree nursery
  • when worked, the tree nursery matures into a forest
  • the mod makes forests replenishable
  • the tree nursery adds +2:hammers: and +1:) to a plot
  • depending on latitude and terrain type the forest produced will change to match:
    polar w/ tundra=snowy forest, temperate=evergreen or leafy forest, equatorial=evergreen or leafy forest, equatorial w/ grass=jungle​
  • 40% chance of jungle in equatorial zones

credit: idea from rezaf in this thread
 
some feedback from recent gameplay:
  • the AI likes making tree nurseries
  • this does result in some nursery->forest->chop->nursery cycling before forest preservation and or lumbermills
  • after forest preserve and lumbermills are availible, the AI keeps the nursery generated forests

I think the mod is working as planned, the world is alot greener later in the game. Consequently the woodsman promotion is more valuable. :goodjob:
 
I have added his mod, along with Basic Damaged Land and Basic Solar Panels, to C2C but have not had any feedback on them.;)
 
I have added his mod, along with Basic Damaged Land and Basic Solar Panels, to C2C but have not had any feedback on them.;)

good to hear :)

i havent got past gunpowder in my current game to see how those mods play in a real game. it will be awhile since my current game is on marathon :crazyeye:

let me know if any tweaks are in order! :goodjob:
 
How do I stop workers being able to build "new forest" on existing "forest"?

after looking at the XML i dont think there is a simple way to do this. you could set the game option "workers leave forests". I usually have that set.

As far as the AI behaviour, i think you're experiencing general AI worker dumbness.

sorry :(
 
Maybe you should remove lumbermills. This mod basically replicates the function of lumbermills - but you get the hammers in one block with the chopping, instead of year-by-year.

i see your point, clear cutting and planting is how some modern tree harvesting is done.

as far as game play, there are advantages to having a forest always on the plot producing hammers. therefore leaving the lumber mill as is works.
 
update to 1.1:

*added latitude and terrain dependant forest graphics!
polar w/ tundra=snowy forest, temperate=evergreen or leafy forest, equatorial=evergreen or leafy forest, equatorial w/ grass=jungle
*40% chance of jungle in equatorial zones

python code change:
Spoiler :
Code:
			chance=CyGame().getSorenRandNum(100, "modifieda4")
			lat=pPlot.getLatitude()
			if lat > 60:
            			region="POLAR"
        		elif lat > 25:
            			region="TEMPERATE"
        		elif lat > 0:
           			region="EQUATOR"
        		elif lat > -25:
            			region="EQUATOR"
        		elif lat > -60:
           			region="TEMPERATE"
        		else:
            			region="POLAR"

			if region=="POLAR":
				if (pPlot.getTerrainType()==gc.getInfoTypeForString('TERRAIN_TUNDRA')):
					pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_FOREST'), 2) ##snowy forest
				else:
					pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_FOREST'), 1) ##evergreen forest
			elif region=="TEMPERATE":
				if chance <= 50:
					pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_FOREST'), 0) ##leafy forest				
				else:
					pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_FOREST'), 1) ##evergreen forest
			elif region=="EQUATOR":
				if chance <= 30:
					pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_FOREST'), 0) ##leafy forest				
				elif chance <= 60:
					pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_FOREST'), 1) ##evergreen forest
				else:
					if (pPlot.getTerrainType()==gc.getInfoTypeForString('TERRAIN_GRASS')):
						pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_JUNGLE'), 0) ##jungle
					else:
						pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_FOREST'), 0) ##leafy forest
 
Actually, there is a default standard lattitude in BTS to determine which forest to spawn.

This is what I observed in BTS maps
Code:
if pPlot.getLatitude() < 27:
	pPlot.setFeatureType(gc.getInfoTypeForString("FEATURE_FOREST"), 0)
elif pPlot.getLatitude() < 54:
	pPlot.setFeatureType(gc.getInfoTypeForString("FEATURE_FOREST"), 1)
else:
	pPlot.setFeatureType(gc.getInfoTypeForString("FEATURE_FOREST"), 2)
 
Actually, there is a default standard lattitude in BTS to determine which forest to spawn.

This is what I observed in BTS maps
Code:
if pPlot.getLatitude() < 27:
	pPlot.setFeatureType(gc.getInfoTypeForString("FEATURE_FOREST"), 0)
elif pPlot.getLatitude() < 54:
	pPlot.setFeatureType(gc.getInfoTypeForString("FEATURE_FOREST"), 1)
else:
	pPlot.setFeatureType(gc.getInfoTypeForString("FEATURE_FOREST"), 2)

similar, i guess my values are for a slightly warmer planet. because I check for tundra etc, before placing the forest, the net effect of the difference should be not noticable.

otherwise a snowy forest could be placed on a grass plains. :cry:
 
after looking at the XML i dont think there is a simple way to do this. you could set the game option "workers leave forests". I usually have that set.

As far as the AI behaviour, i think you're experiencing general AI worker dumbness.

sorry :(

Actually there is a solution for it, one that I think DH should know also, but just want to avoid using it.

Activate def canBuild python callback and disable it for Forest Tiles.

Didn't want to cast necromancy, but was looking for a simple improvement mod to serve as my base to try something :mischief:
 
Actually there is a solution for it, one that I think DH should know also, but just want to avoid using it.

Activate def canBuild python callback and disable it for Forest Tiles.

Didn't want to cast necromancy, but was looking for a simple improvement mod to serve as my base to try something :mischief:

Yea, using the canBuild callback slows things down and I have not figured out how to use that call for two different units - we are already using it for the C2C Great Farmer. There is another option in C2C as well.

I was going to try using the terrain and featurebooleans tags for a solution. I think that works for bare terrain or the terrain with the features in the booleans.
 
Well, for the same iBuild, I guess even for 2 different units, they should be having the same conditions, unless you mean the normal worker cannot build XXX under certain conditions, but the Great Farmer can build XXX under certain conditions.

If that is the case, then simply use 2 different iBuilds to achieve the same result and assign them differently, 1 for normal worker, 1 solely for Great Farmer and problem solved.
 
How do I stop workers being able to build "new forest" on existing "forest"?

I have finally figured out how to do this. It was a "duh!" moment. In the Build Infos file you set the tech for the features you don't want to replace to TECH_FUTURE_TECH. That way it can never be built.
 
Top Bottom