Ok, I'm trying to attach the same type of +1 to food/prod/commerce/research that the nutrition and mining facilities have.
I think I found out where the Yields get updated in CvFinalFrontier.py
I'm still trying to puzzle out some things. I get the Yield = Yield + extrabuildingyield (I think that's how it works) but what is the multiplier doing?
Probably partially due to not understanding some of the functions called.
Just as a test I am trying to add 1 to commerce if the planet has a Research Lab. Since I need to check this at each planet I dumped my code here:
I'm still at work so I can't test it until I get home
Will what I added work? Is it in the right place? or should I shoot myself in the foot and call it a day? =P
Also I'm almost thinking it might be better to just check current population and add that to research.
Psuedocode:
if planet has research lab
research (before % increases) += current planet pop
Also where do the printd commands send their data?
I've tried every logging command I could track down in game, in INI, log files and searching and must be missing it.
I think I found out where the Yields get updated in CvFinalFrontier.py
Code:
def updatePlotYield(self, pPlot):
pCity = pPlot.getPlotCity()
iOwner = pCity.getOwner()
if (iOwner != -1):
if (pPlot.getFeatureType() == self.iFeatureIDSolarSystem):
pPlayer = gc.getPlayer(iOwner)
pSystem = self.getSystemAt(pPlot.getX(), pPlot.getY())
aiSystemYield = [0,0,0]
# The Forge get's 1 fewer food in all cities
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_THE_FORGE')
if (pPlayer.hasTrait(iTrait)):
aiSystemYield[0] -= 1
# if (pCity.isCapital()):
# aiSystemYield[1] += 2
# Red Syndicate gets +1 food and production for each Trade Route
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_SYNDICATE')
if (pPlayer.hasTrait(iTrait)):
for iTradeCity in range (pCity.getTradeRoutes()):
pTradeCity = pCity.getTradeCity(iTradeCity)
# printd("Trade city object:")
# printd(pTradeCity)
if (pTradeCity):
if (pTradeCity.getName() != ""):
# printd("entering trade route additions")
aiSystemYield[0] += 1
aiSystemYield[1] += 1
# Building mod needs to be done manually
for iBuildingLoop in range(gc.getNumBuildingInfos()):
# Has buildings
if (pCity.getNumRealBuilding(iBuildingLoop) > 0):
pBuildingInfo = gc.getBuildingInfo(iBuildingLoop)
for iYieldLoop in range(3):
if (pBuildingInfo.getYieldChange(iYieldLoop) > 0):
aiSystemYield[iYieldLoop] += (pBuildingInfo.getYieldChange(iYieldLoop) *
pCity.getNumRealBuilding(iBuildingLoop))
I'm still trying to puzzle out some things. I get the Yield = Yield + extrabuildingyield (I think that's how it works) but what is the multiplier doing?
Probably partially due to not understanding some of the functions called.
Just as a test I am trying to add 1 to commerce if the planet has a Research Lab. Since I need to check this at each planet I dumped my code here:
Code:
for iPlanetLoop in range(pSystem.getNumPlanets()):
pPlanet = pSystem.getPlanetByIndex(iPlanetLoop)
printd(" Planet at Ring ID %d" %(pPlanet.getOrbitRing()))
# added by NNCSavage 08/07/2007
# Research Lab adds one to commerce yield
iRlab = CvUtil.findInfoTypeNum(gc.getBuildingInfo, gc.getNumBuildingInfos(), "BUILDING_RESEARCH_LAB")
if pPlanet.isHasBuilding(iRlab):
aiSystemYield[2] += 1
# return to normally schedule programming
for iYieldLoop in range(3):
iValue = (pPlanet.getTotalYield(iOwner, iYieldLoop) * pPlanet.getPopulation())
aiSystemYield[iYieldLoop] += iValue
printd(" Yield %d Value: %d" %(iYieldLoop, iValue))
for iYieldLoop in range(3):
pCity.setBaseYieldRate(iYieldLoop, aiSystemYield[iYieldLoop])
printd(" Setting City Base Yield %d to %d" %(iYieldLoop, aiSystemYield[iYieldLoop]))
I'm still at work so I can't test it until I get home
Will what I added work? Is it in the right place? or should I shoot myself in the foot and call it a day? =P
Also I'm almost thinking it might be better to just check current population and add that to research.
Psuedocode:
if planet has research lab
research (before % increases) += current planet pop
Also where do the printd commands send their data?
I've tried every logging command I could track down in game, in INI, log files and searching and must be missing it.