feedback:food?

mild

Chieftain
Joined
Oct 18, 2011
Messages
9
as you see,the “Worked Tiles” have 17 point food,but.just have 15 point food for city growing
Civ4ScreenShot0000.jpg
[/URL][/IMG]
 
Hmm that's puzzling. The most likely cause for a 2 food discrepancy is some sort of error with the Paganism civic. The bonus food from that may have been removed twice for some reason. Could you try adopting and dropping the Paganism civic a few times and see what that does? Likewise, switching between having a state religion and no state religion?
 
Hmm that's puzzling. The most likely cause for a 2 food discrepancy is some sort of error with the Paganism civic. The bonus food from that may have been removed twice for some reason. Could you try adopting and dropping the Paganism civic a few times and see what that does? Likewise, switching between having a state religion and no state religion?
When State Religion spread in, the food production will not add automatically, this is the main problem.
Also I have found a bug, BUILDINGCLASS_PALACE_RECIPROCITY need to add 1 hapiness under Monarchy
 
Hmm that's puzzling. The most likely cause for a 2 food discrepancy is some sort of error with the Paganism civic. The bonus food from that may have been removed twice for some reason. Could you try adopting and dropping the Paganism civic a few times and see what that does? Likewise, switching between having a state religion and no state religion?

We couldn't find the code for adding food when state religion spread to a new city -- we think this is what caused the bug to occur.

This is how we fixed it: in file CvEventManager.py, replace function onReligionSpread() and onReligionRemove() with the following code:
Code:
	def onReligionSpread(self, argsList):
		'Religion Has Spread to a City'
		iReligion, iOwner, pSpreadCity = argsList
					
		# BUG-FIX: Extra Yield from State Religion
		pPlayer = gc.getPlayer(iOwner)
		iStateReligion = pPlayer.getStateReligion()
		if iStateReligion == iReligion:
			for iYieldType in range(3):
				iCivic = HR.getStateReligionYieldCivic(iYieldType)
				if pPlayer.isCivic(iCivic):
					iYieldChange = HR.getStateReligionYieldCivicChange(iYieldType)
					pSpreadCity.changeBaseYieldRate(iYieldType, iYieldChange)
		# end of BUG-FIX
		
		player = PyPlayer(iOwner)
		if (not self.__LOG_RELIGIONSPREAD):
			return
		CvUtil.pyPrint('%s has spread to Player %d Civilization %s city of %s'
			%(gc.getReligionInfo(iReligion).getDescription(), iOwner, player.getCivilizationName(), pSpreadCity.getName()))
			

	def onReligionRemove(self, argsList):
		'Religion Has been removed from a City'
		iReligion, iOwner, pRemoveCity = argsList
		
		# BUG-FIX: Extra Yield from State Religion
		pPlayer = gc.getPlayer(iOwner)
		iStateReligion = pPlayer.getStateReligion()
		if iStateReligion == iReligion:
			for iYieldType in range(3):
				iCivic = HR.getStateReligionYieldCivic(iYieldType)
				if pPlayer.isCivic(iCivic):
					iYieldChange = HR.getStateReligionYieldCivicChange(iYieldType)
					pRemoveCity.changeBaseYieldRate(iYieldType, iYieldChange * -1)
		# end of BUG-FIX
		
		player = PyPlayer(iOwner)
		if (not self.__LOG_RELIGIONSPREAD):
			return
		CvUtil.pyPrint('%s has been removed from Player %d Civilization %s city of %s'
			%(gc.getReligionInfo(iReligion).getDescription(), iOwner, player.getCivilizationName(), pRemoveCity.getName()))

Hope this helps:) (I am not familiar with civ4-modding, the fix is tested working, but you better double-check the code)
 
The fix for BUILDINGCLASS_PALACE_RECIPROCITY is to add :
Code:
<BuildingHappinessChange>
<BuildingType>BUILDINGCLASS_PALACE_RECIPROCITY</BuildingType>
<iHappinessChange>1</iHappinessChange>
</BuildingHappinessChange>
to \Assets\XML\GameInfo\CIV4CivicInfos.xml entry CIVICOPTION_GOVERNMENT
(provided by myclan)
 
We couldn't find the code for adding food when state religion spread to a new city -- we think this is what caused the bug to occur.

This is how we fixed it: in file CvEventManager.py, replace function onReligionSpread() and onReligionRemove() with the following code:

That code will indeed fix the problem. Looks like I'd addressed this already in my test version but neglected to copy it to the 1.19 release version.

The fix for BUILDINGCLASS_PALACE_RECIPROCITY is to add :
Code:
<BuildingHappinessChange>
<BuildingType>BUILDINGCLASS_PALACE_RECIPROCITY</BuildingType>
<iHappinessChange>1</iHappinessChange>
</BuildingHappinessChange>
to \Assets\XML\GameInfo\CIV4CivicInfos.xml entry CIVICOPTION_GOVERNMENT
(provided by myclan)

Yep. I've fixed this for 1.20 already :)
 
That code will indeed fix the problem. Looks like I'd addressed this already in my test version but neglected to copy it to the 1.19 release version.

Yep. I've fixed this for 1.20 already :)

Great:goodjob:
 
1) Not sure if I told you before...
Your changeReligionExtraYield function will malfunction when cities are conquered.

Code:
	for iCity in range(pPlayer.getNumCities()):
		pCity = pPlayer.getCity(iCity)

This style of coding failed because when a city is captured, it still takes up the "space" there in the player city list.

Simple Example:
Player X:
City A, B, C and D , 4 Cities
B is conquered.

Now:
Player X:
City A, , C and D , 3 Cities

Using that style of coding, it will just check A, , C and stops.
When a new city is built, it then goes into the empty slot.

2) Also, there isn't any onCityAcquired codes for your Extra Yield Civics.
So it will still fail when cities change hands even with the above fix.
 
The fix for BUILDINGCLASS_PALACE_RECIPROCITY is to add :
Code:
<BuildingHappinessChange>
<BuildingType>BUILDINGCLASS_PALACE_RECIPROCITY</BuildingType>
<iHappinessChange>1</iHappinessChange>
</BuildingHappinessChange>
to \Assets\XML\GameInfo\CIV4CivicInfos.xml entry CIVICOPTION_GOVERNMENT
(provided by myclan)

Rather than setting this, why not simply set building class of "Modified Palace" to be Palace as well.
No need to have two different building class.
 
Rather than setting this, why not simply set building class of "Modified Palace" to be Palace as well.
No need to have two different building class.

There was a reason I didn't do that but I cannot remember for the life of me what it was. Will try it again.
 
Back
Top Bottom