Announcement

Collapse
No announcement yet.

Growable forest, like cottage....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Growable forest, like cottage....

    Looked over the file CIV4Improvementinfos.xml

    It should be fairly easy to add an improvement that uses the same structure as cottages, and similar graphics as the forest.



    The thing is, however, the game would recognize it as an improvement, and not as a forest "special feature". Therefore you could not cut it down (which i assume would be a good thing). The other thing is, however, it wouldn't give off health benefits - the number one reason to planting forests in the first place. Perhaps inserting the phrase " < iHealthPercent> 40< /iHealthPercent > " into the improvements file will work, but alas i haven't tried.

  • #2
    It would be pillagable..... (But you don't profit from pillaging your own structures.... I tried that)
    -----------------
    Backpack
    ---- "What gunpowder did for war, Blake has done for the AI" - Diadem ----

    Comment


    • #3
      As this thread kinda died down even though I figure there are some people who would want such feature, I'm taking the libery of bumping it.

      I introduced "Tree Schools" into my game, which allow a tree school improvement which does not yield any resource gain, but after being worked on for 40 turns will transform into a regular forest.
      It's NOT an improvement, it's a real forest.

      Here's what needs to be coded in in order to pull it off:

      Edit: If you just wanna use the feature, scroll down a few posts to where I provided a mod download that doesn't require you to touch any game files yourself any longer.

      In CvEventManager.py:
      def onImprovementBuilt(self, argsList):
      'Improvement Built'
      iImprovement, iX, iY = argsList
      iPlayer = CyGame().getActivePlayer()
      pPlot = CyMap().plot(iX,iY)
      player = gc.getPlayer(iPlayer)
      if(iImprovement==25):
      Plot.setFeatureType(CyGlobalContext().getInfoTypeF orString("FEATURE_FOREST"),-1)
      pPlot.setImprovementType(-1)
      if (not self.__LOG_IMPROVEMENT):
      return
      CvUtil.pyPrint('Improvement %s was built at %d, %d'
      %(PyInfo.ImprovementInfo(iImprovement).getDescript ion(), iX, iY))
      In CIV4BuildInfos.xml
      <BuildInfo>
      <Type>BUILD_TREESCHOOL</Type>
      <Description>TXT_KEY_BUILD_TREESCHOOL</Description>
      <Help/>
      <PrereqTech>TECH_BIOLOGY</PrereqTech>
      <iTime>500</iTime>
      <bKill>0</bKill>
      <ImprovementType>IMPROVEMENT_TREESCHOOL</ImprovementType>
      <RouteType>NONE</RouteType>
      <EntityEvent>ENTEVENT_BUILD</EntityEvent>
      <FeatureStructs/>
      <HotKey>KB_P</HotKey>
      <bAltDown>0</bAltDown>
      <bShiftDown>1</bShiftDown>
      <bCtrlDown>0</bCtrlDown>
      <iHotKeyPriority>1</iHotKeyPriority>
      <Button&gt,Art/Interface/Buttons/TerrainFeatures/Forest.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,1 ,9</Button>
      </BuildInfo>
      In CIV4GameTextInfos.xml

      <TEXT>
      <Tag>TXT_KEY_BUILD_TREESCHOOL</Tag>
      <English>Build a Tree School</English>
      <French>construire une plantation</French>
      <German>Baumschule bauen</German>
      <Italian>Costruisci una piantagione</Italian>
      <Spanish>Construir una plantación</Spanish>
      </TEXT>
      In CIV4ImprovementInfos.xml

      <ImprovementInfo>
      <Type>IMPROVEMENT_TREESCHOOL</Type>
      <Description>TXT_KEY_IMPROVEMENT_TREESCHOOL</Description>
      <Civilopedia>TXT_KEY_IMPROVEMENT_PLANTATION_PEDI A</Civilopedia>
      <ArtDefineTag>ART_DEF_IMPROVEMENT_PLANTATION</ArtDefineTag>
      <PrereqNatureYields/>
      <YieldChanges/>
      <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>
      <iTilesPerGoody>0</iTilesPerGoody>
      <iGoodyRange>0</iGoodyRange>
      <iUpgradeTime>40</iUpgradeTime>
      <iAirBombDefense>5</iAirBombDefense>
      <iDefenseModifier>0</iDefenseModifier>
      <iPillageGold>5</iPillageGold>
      <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_TREESCHOOL_II</ImprovementUpgrade>
      <TechYieldChanges/>
      <RouteYieldChanges/>
      <bGraphicalOnly>0</bGraphicalOnly>
      </ImprovementInfo>
      <ImprovementInfo>
      <Type>IMPROVEMENT_TREESCHOOL_II</Type>
      <Description>TXT_KEY_IMPROVEMENT_TREESCHOOL</Description>
      <Civilopedia>TXT_KEY_IMPROVEMENT_PLANTATION_PEDI A</Civilopedia>
      <ArtDefineTag>ART_DEF_IMPROVEMENT_PLANTATION</ArtDefineTag>
      <PrereqNatureYields/>
      <YieldChanges/>
      <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>
      <iTilesPerGoody>0</iTilesPerGoody>
      <iGoodyRange>0</iGoodyRange>
      <iUpgradeTime>1</iUpgradeTime>
      <iAirBombDefense>5</iAirBombDefense>
      <iDefenseModifier>0</iDefenseModifier>
      <iPillageGold>5</iPillageGold>
      <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>
      And in CIV4GameTextInfos_Objects.xml

      <TEXT>
      <Tag>TXT_KEY_IMPROVEMENT_TREESCHOOL</Tag>
      <English>Tree School</English>
      <French>
      <Text>Tree School</Text>
      <Gender>Female</Gender>
      <Plural>0</Plural>
      </French>
      <German>
      <Text>Baumschule</Text>
      <Gender>Female</Gender>
      <Plural>0</Plural>
      </German>
      <Italian>
      <Text>Piantagione:Piantagioni</Text>
      <Gender>Female</Gender>
      <Plural>0:1</Plural>
      </Italian>
      <Spanish>
      <Text>Plantación:Plantaciones</Text>
      <Gender>Female</Gender>
      <Plural>0:1</Plural>
      </Spanish>
      </TEXT>
      Sorry, but the tabs kinda fail to show up in the post.

      I put this into the game by replacing the appropriate section in the .py file and by backing up and then modifying the xml files. If anybody can tell me how to make this a mod I can choose and then start a custom game like I do in a vanilla game, please kindly reply to this thread.

      Also, I'd like to have the "A Forest has grown near xxx" to show, along with the pointer on the map. Any hint on how to make this happen would also be appreciated.

      Finally, there are no proper texts in the French, Italian and Spanish tags. Native speakers, feel free to post the correct translations.

      As it stands, you can make the above modifications and upon discovering Biology, you will gain the ability to construct Tree Schools. If you work these for 40 turns, they will convert to a forest. That's it, basically.

      As soon as anyone tells me how to put this stuff into seperate xml/py files, I will create and attach those.

      Cheers
      _____
      rezaf
      Last edited by rezaf; November 4, 2005, 07:36.
      _____
      rezaf

      Check out my Forest planting mod or my Terrain adaption mod

      Comment


      • #4
        YOU sir... ARE THE MAN!

        Can i simply copy and paste or must i format it?

        Comment


        • #5
          Why not just use a lumbermill- it accomplishes the same darned thing as far as gaining resoucres- except it uses pop and seems better balanced than this idea.

          Comment


          • #6
            Originally posted by dearmad
            Why not just use a lumbermill- it accomplishes the same darned thing as far as gaining resoucres- except it uses pop and seems better balanced than this idea.
            Uhh.. say what?


            YOu realize you can't build a lumbermill if you don't have a forest, right?

            Comment


            • #7
              Originally posted by MattPilot
              YOU sir... ARE THE MAN!

              Can i simply copy and paste or must i format it?
              I'd guess basic formating is necessary, but just look into the appropriate files and how often you need to hit tab is evident.

              Why not just use a lumbermill- it accomplishes the same darned thing as far as gaining resoucres- except it uses pop and seems better balanced than this idea.
              Erm ... what? A lumbermill is something completely different. It can enhance the productive capabilities of a forest square. What I posted is meant to accomplish something completely different: Enable you to plant a forest in a Plain, Grassland or Tundra tile.

              I'll be trying to come up with more terraforming based bits like this one, to bring back basic terraforming options like you had back in Civ1/2. I was really disappointed how Civ3 cut back on this front, and Civ4 went along, obviously. But as it's rather easy to mod in in Civ4, I just went ahead and did it.
              _____
              rezaf
              _____
              rezaf

              Check out my Forest planting mod or my Terrain adaption mod

              Comment


              • #8
                Nice idea and mod, it makes sense for it take awhile before it becomes a forest and balances it doing it that way as well. Also you might want to check the Desert War/American Revolution mod, they use custom python files for some of their stuff.
                "Every good communist should know political power grows out of the barrel of a gun." - Mao tse-Tung

                Comment


                • #9
                  Originally posted by MattPilot


                  Uhh.. say what?


                  YOu realize you can't build a lumbermill if you don't have a forest, right?
                  Thus conservation...? The game *choice*.

                  Comment


                  • #10
                    Great mod! Really makes it a little more realistic - in the middle ages so many forrests have been chopped down, look outside now (maybe after you finish one game and before starting another ), there are some forrests again, yes, because of reforestation programs.
                    I think your concept is just right, although 40 turns seem to be a little long (especially in the late game) - maybe 20 turns would be better. Also, a tree school should be buildable on hills, too, IMO.

                    *thumbs-up*

                    Comment


                    • #11
                      Originally posted by ChaotikVisions
                      Nice idea and mod, it makes sense for it take awhile before it becomes a forest and balances it doing it that way as well. Also you might want to check the Desert War/American Revolution mod, they use custom python files for some of their stuff.
                      While I agree that having a regrow time makes sense, I have to say that I actually read this in a thread somewhere on these boards back when I didn't have the game yet. (Failed to locate it now, though).

                      I did check the other mods, but I'm under the impression that you can only put in rules when you include a map. However, I want the Forest planting to be in some files you can just include and then play a custom game like you used to. Hope somebody will eventually hint me how.

                      Originally posted by dearmad
                      Thus conservation...? The game *choice*.
                      Nobody's forcing you to use these modifications. I liked the ability to replant forests, though, so I'm glad to have it back.

                      Originally posted by JDexter
                      I think your concept is just right, although 40 turns seem to be a little long (especially in the late game) - maybe 20 turns would be better. Also, a tree school should be buildable on hills, too, IMO.
                      I agree with that to some extent. I figured even if I have 1yr=1turn, 40 years would be a realistic time for a forest to regrow, but I also agree that in gameplay terms, it's a bit slow. I might lower that number after some playtesting.
                      Also agree on the hills statement. I was under the impression that this should be possible, due to a non-existant RequiresFlatGround variable, but appearently it is not. What did I miss to adjust?
                      _____
                      rezaf
                      _____
                      rezaf

                      Check out my Forest planting mod or my Terrain adaption mod

                      Comment


                      • #12
                        Actually, I have been thinking about forests lately also, albeit along different lines. When the British Empire was in it's heyday, naval stores were considered a vital resource. Most large timber was purchased from the Baltic regions, as well as shipped from the New World. In fact, the cutting of large timber in the English American colonies was very illegal. It was reserved for the Royal Navy.

                        I had thought of adding a "Large Timber" strategic resource that would be required for the larger ships of sail. The twist would be to make it depletable over time of use, and growing over time in forests that are not being used. Maybe after the age of sail, it becomes a commercial luxery item? I think that I would have to do a study in order to determine the characteristics of trees suitable for naval use, because they certainly could not be found everywhere, even in old growth forests. For instance, it takes around 150 years for an Eastern American hardwood forest to be considered "old growth".

                        After reading this thread, I thought that these two ideas are somewhat similiar, and could possibly work well together. I would like to offer a suggestion though. Instead of having your forests grow in turns, could you not make it time dependant in years? This would model the modern age much more accurately (cutting trees can happen much faster than growing).

                        Nice job on the script rezaf!

                        Comment


                        • #13
                          Originally posted by Eric Snyder
                          I had thought of adding a "Large Timber" strategic resource <snip>

                          Instead of having your forests grow in turns, could you not make it time dependant in years?
                          <snip>

                          Nice job on the script rezaf!
                          Thanks on the last one. Though I feel this is rather crude, as far as scripting goes, I'm glad I managed to get it working at all, with almost no documentation available.

                          About the strategic resource idea ... I'd love to have more of those, and timber seems like a very rational addition, but as far as I understand, it's impossible to add new map objects for them as of now. Sure, you could just scavenge existing art like I did, for example utiliting the banana tree artwork, but still...

                          Finally, about upgrade time ... it's coded in the XML file as of now and there it only gives you UpgradeTime=x, which I figure translates into turns. I guess having it take x years instead would be possible, but would require more extensive python coding.

                          One more thing: cheers go to ChaotikVisions who displayed how to properly add code as a mod to me with his faith mod. Thus, I created the necessary files, and now you can extract my Forestry Mod into your mod directoy and then activate it in the Advanced setting from within the game. No longer need you modify any files yourself.

                          Edit: btw, I lowered the growth time from Tree School to forest from 40 to 25 and changed the required technology from Biology to Guilds.

                          Edit: I posted an upgraded version of this mod in a thread of it's own. Linky link.
                          Last edited by rezaf; November 8, 2005, 12:06.
                          _____
                          rezaf

                          Check out my Forest planting mod or my Terrain adaption mod

                          Comment


                          • #14
                            Thx for the files! IT made copy & pasting easier. But i do appreciate you also giving instructions, otherwise i could of never incorporated it into my mod without deleting my other changes.


                            Anyway, there is one little mistake i found while copy&pasting.

                            You forgot to give the Indian Fastworker the ability to build it too.

                            CIV4UnitInfos.xml

                            Comment


                            • #15
                              hmm....

                              I don't think its working


                              I started up a modern age game and started building 2 tree farms.

                              After 6 turns they turned into tree schools (stage 2, i suppose).

                              But after that, nothing happened.



                              Just to make something sure - the idea is for it to grow into a regular old forest, with no improvement on it, right?

                              Comment

                              Working...
                              X