Announcement

Collapse
No announcement yet.

How do I...?

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

  • How do I...?

    Okay, so I've got an idea for a mod but I need to know how to get the effects I want.

    I want to make some changes to how resources are handled. Food resources would add +2 health and +1 food to the entire empire. Industrial resources would add +1 industry to every city in the empire. Luxury resources would add +2 commerce and +1 happiness to every city in the empire.

    Also, I want grocers and supermarkets to add +1 food in addition to their health change.

    In Civ4buildingsinfos.xml, there's a snippet for the healthchange, but there's no similar place to put in food change. I want to know how to add that in and, more important, if it's possible using the xml files.

    In Civ4bonusinfos.xml, there's also an tag, but no tag or similar to modify to achieve this effect.
    Mylon Mod - Adressing game pace and making big cities bigger.
    Inquisition Mod - Exterminating heretic religions since 1200 AD

  • #2
    Also, I want to add another culture level so culture works a little better in cases where cities aren't jammed against one another. Is this possible?
    Mylon Mod - Adressing game pace and making big cities bigger.
    Inquisition Mod - Exterminating heretic religions since 1200 AD

    Comment


    • #3
      Culture levels is possible, I just tested it. You just need to mod two XML files. First is Assets/XML/GameInfo/CIV4CultureLevelInfo.xml the file is pretty straight forward, you can copy/paste entries and just edit the values.

      Just remember what you changed the name for the TXT_KEY_CULTURELEVEL_YOURCULTURENAMEHERE entry to, because you need it when you edit the Assets/XML/Text/Civ4GameTextInfos.xml file.

      In that file just do a find for TXT_KEY_CULTURELEVEL_NONE as its the start of the list. You can just copy/paste again adding in the new TXT_KEY... entry and the new describer word(this is what they'll see when they mouse over or such, like None-Poor-Fledgling-etc..).

      Hope that helps, i'm not sure about the other stuff, it might only be possible through Python.
      "Every good communist should know political power grows out of the barrel of a gun." - Mao tse-Tung

      Comment


      • #4
        Okay, it seems adding resources as a flat bonus is a bad idea since it favors ICS. ICS is limited to 3x3, but still...

        Instead I want to add them as food bonuses. Each food resource adds +10% to food in addition to its +1 health.

        As another change, population adds culture and buildings add a percentage, just like the broadcast tower but at smaller rates.

        I figure I will probably need python to do this, so I'm requesting help on where to start. The building changes I can do, but food bonuses and culture from population I'll need guidance.

        All I see that might be relevant so far is in CvEventManager.py:

        Code:
        def onCityDoTurn(self, argsList):
        		'City Production'
        		pCity = argsList[0]
        		iPlayer = argsList[1]
        
        		CvAdvisorUtils.cityAdvise(pCity, iPlayer)
        but it doesn't really offer any idea of how to insert additional events.
        Last edited by Mylon; November 3, 2005, 09:43.
        Mylon Mod - Adressing game pace and making big cities bigger.
        Inquisition Mod - Exterminating heretic religions since 1200 AD

        Comment


        • #5
          Okay, in Pyhelpers.py under class Pycity, there is:

          Code:
          def getPopulation(self):
          		"int - City Population"
          		return self.city.getPopulation()
          ...
          def getFoodRate(self):
          		"int - Total Food Yield"
          		return self.city.getYieldRate(YieldTypes.YIELD_FOOD)
          ...
          	def getPopulation(self):
          		"int - City Population"
          		return self.city.getPopulation()
          ...
          	def getGoodHealth(self):
          		"int - Health rating"
          		return self.city.goodHealth()
          	
          	def getBadHealth(self):
          		"int - Unhealthy rating"
          		return self.city.badHealth(False)
          So here's where I get the values used for this mod, but I'm still searching for where I would apply these numbers.

          I'd imagine it would be something like

          Code:
          onCityDoTurn(self, arglist):
          	((addfood)) = Pycity.getFoodRate(self) * (getGoodHealth(self) - def getBadHealth(self)) * 0.05:
          I wouldn't imagine this would properly show up on a tooltip though and might confuse the player and/or not trigger the city growth event. Plus I'm still looking for the addfood function.
          Mylon Mod - Adressing game pace and making big cities bigger.
          Inquisition Mod - Exterminating heretic religions since 1200 AD

          Comment


          • #6
            Okay, I did a little test and the onCityDoTurn function doesn't process: I added a debug message in with a line to edit the food yield and the debug message never showed up, nor did the food. Curiously enough, there's also a culture message:

            Code:
            	def onCultureExpansion(self, argsList):
            		CvUtil.pyPrint("City %s's culture has expanded" %(pCity.getName(),))
            but this message doesn't display. Rather, it's "%s's borders have expanded." or something along those lines. So far I haven't found where that message is stored, or if it's even python controlled.
            Mylon Mod - Adressing game pace and making big cities bigger.
            Inquisition Mod - Exterminating heretic religions since 1200 AD

            Comment

            Working...
            X