Added a line of code to the Sphinx so that the wonder bonus doesn't apply to the Sphinx itself which was causing large amounts of free production overflow upon construction of the Sphinx.
I get some seemingly non-fatal python errors in CvEventManager.py that seems to relate to Copernicus. I've attached the screenshot from civ.
Never mid the line numbers as I've (carefully) merged the file from an original file, Copernicus, Golden Gate Bridge etc. To make it easier I've also attached my modded .py-file
The line numbers are (Italic correspons to the line with the problem - removed some tabs to make text fit):
Line no 398:
## Copernicus Start ##
## Determines How Often the Stars Change
if ( iGameTurn % 10 ) == 0:
self.doChooseNewStarAlignment( )
## Copernicus End ##
Line no 1468:
if self.iStarAlignment == 4:
szTitle = localText.getText( "TXT_KEY_GODS_STARS_LION", ( ) )
CyInterface().addImmediateMessage( szTitle , None)
self.doStarGoldBonus( "NONE" )if self.iStarAlignment == 5:
Line no 1522
def doStarGoldBonus( self, szReligion ):
lPlayers = PyGame().getCivPlayerList( )
for iPlayer in range( len( lPlayers ) ):
if ( lPlayers[ iPlayer ].getStateReligion( ) == CvUtil.findInfoTypeNum(gc.getReligionInfo,gc.getNumReligionInfos(), szReligion ) ) or ( lPlayers[ iPlayer ].getStateReligion( ) != CvUtil.findInfoTypeNum(gc.getReligionInfo,gc.getNumReligionInfos(), szReligion ) ):
Hope it helps and that I haven't screewed up
\Skodkim
Anyway, I know several people like my wonders mainly for the code which they apply to their own ideas and buildings, so people can copy this as a way to remove National Unit Caps for other units.
Good idea, like everytime.
But damn, i've said in my mod-developement-thread, that this can't be done.
mmmh, having a new feature, but confessing being stupid, or not a new feature to appear more intelligent?
-> New feature.
Hmm it looks like you either forgot to merge or merged incorrectly the PyHelpers python file included with the modcomp. Searching for "Copernicus' Observatory" finds the changes in there as well. If you're using a mod that doesn't edit that file you don't need to merge persay just move the whole file into the python directory.
(Basically the Eventmanager is calling back to PyHelpers and not finding the function there).
I noticed a small bug with the Leonardo's Workshop code. My great general unit, after building the wonder, now requires cash to be upgraded. This might be because the check for Leonardo's Workshop comes after the check for the great general.
I'm still getting a massive discount on my army, so it's not a huge problem. Just a feature others might pick up on.
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_LEADER')):
iPrice = 0
## Leonardo's Workshop Start ##
pPlayer = gc.getPlayer(iPlayer)
pUnit = pPlayer.getUnit(iUnitID)
iPrice = gc.getDefineINT("BASE_UNIT_UPGRADE_COST")
iPrice += (max(0, (pPlayer.getUnitProductionNeeded(iUnitTypeUpgrade) - pPlayer.getUnitProductionNeeded(pUnit.getUnitType()))) * gc.getDefineINT("UNIT_UPGRADE_COST_PER_PRODUCTION"))
if ((not pPlayer.isHuman()) and (not pPlayer.isBarbarian())):
pHandicapInfo = gc.getHandicapInfo(gc.getGame().getHandicapType())
iPrice = iPrice * pHandicapInfo.getAIUnitUpgradePercent() / 100
iPrice = iPrice * max(0, ((pHandicapInfo.getAIPerEraModifier() * pPlayer.getCurrentEra()) + 100)) / 100
iPrice = iPrice - ((iPrice * pUnit.getUpgradeDiscount()) / 100)
b_Leonardo = gc.getInfoTypeForString("BUILDING_LEONARDO")
obsoleteTech = gc.getBuildingInfo(b_Leonardo).getObsoleteTech()
if ( gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1 ):
for iCity in range(pPlayer.getNumCities()):
ppCity = pPlayer.getCity(iCity)
if ppCity.getNumActiveBuilding(b_Leonardo) == true:
iPrice = ((gc.getDefineINT("BASE_UNIT_UPGRADE_COST"))/2)
iPrice += (((max(0, (pPlayer.getUnitProductionNeeded(iUnitTypeUpgrade) - pPlayer.getUnitProductionNeeded(pUnit.getUnitType()))) * gc.getDefineINT("UNIT_UPGRADE_COST_PER_PRODUCTION")))/2)
if ((not pPlayer.isHuman()) and (not pPlayer.isBarbarian())):
pHandicapInfo = gc.getHandicapInfo(gc.getGame().getHandicapType())
iPrice = ((iPrice * pHandicapInfo.getAIUnitUpgradePercent() / 100)/2)
iPrice = ((iPrice * max(0, ((pHandicapInfo.getAIPerEraModifier() * pPlayer.getCurrentEra()) + 100)) / 100)/2)
iPrice = ((iPrice - ((iPrice * pUnit.getUpgradeDiscount()) / 100))/2)
[B] if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_LEADER')):
iPrice = 0[/B]
return iPrice
## Leonardo's Workshop End ##
Hi tsentom1,
I am having trouble getting the King Richard's Crusade wonder to work. I have added the Crusade Unit and the Python code to CvEventManager.py. However, the event just never seems to fire. I don't see anything in the logs and the Crusader unit never gets created. Any hints on how I might be mucking this up?
Cheers,
ripple01
def onBeginPlayerTurn(self, argsList):
'Called at the beginning of a players turn'
iGameTurn, iPlayer = argsList
## Crusade Start ##
pPlayer = gc.getPlayer(iPlayer)
b_Crusade = gc.getInfoTypeForString("BUILDING_CRUSADE")
obsoleteTech = gc.getBuildingInfo(b_Crusade).getObsoleteTech()
if ( gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1 ):
for iCity in range(pPlayer.getNumCities()):
ppCity = pPlayer.getCity(iCity)
if ppCity.getNumActiveBuilding(b_Crusade) == true:
iX = ppCity.getX()
iY = ppCity.getY()
u_crusader = gc.getInfoTypeForString( 'UNIT_CRUSADER' )
estiEnd = CyGame().getEstimateEndTurn()
if ( estiEnd >= 1000 ):
if ( iGameTurn % 12 ) == 0:
for i in range(1):
pNewUnit = pPlayer.initUnit( u_crusader, iX, iY, UnitAITypes.UNITAI_ATTACK_CITY, DirectionTypes.NO_DIRECTION )
elif ( estiEnd >= 700 ):
if ( iGameTurn % 8 ) == 0:
for i in range(1):
pNewUnit = pPlayer.initUnit( u_crusader, iX, iY, UnitAITypes.UNITAI_ATTACK_CITY, DirectionTypes.NO_DIRECTION )
elif ( estiEnd >= 500 ):
if ( iGameTurn % 6 ) == 0:
for i in range(1):
pNewUnit = pPlayer.initUnit( u_crusader, iX, iY, UnitAITypes.UNITAI_ATTACK_CITY, DirectionTypes.NO_DIRECTION )
elif ( estiEnd >= 300 ):
if ( iGameTurn % 4 ) == 0:
for i in range(1):
pNewUnit = pPlayer.initUnit( u_crusader, iX, iY, UnitAITypes.UNITAI_ATTACK_CITY, DirectionTypes.NO_DIRECTION )
else:
if ( iGameTurn % 4 ) == 0:
for i in range(1):
pNewUnit = pPlayer.initUnit( u_crusader, iX, iY, UnitAITypes.UNITAI_ATTACK_CITY, DirectionTypes.NO_DIRECTION )
basechance = 12
estiEnd = CyGame().getEstimateEndTurn()
if ( estiEnd >= 1000 ):
basechance = basechance
elif ( estiEnd >= 700 ):
basechance = 6
elif ( estiEnd >= 500 ):
basechance = 4
elif ( estiEnd >= 300 ):
basechance = 2
else:
basechance = 1
chance = CyGame().getSorenRandNum(basechance, "free state religion spread chance")
if ( chance == 0 ):
lppCityUber5 = []
for iiCity in range(pPlayer.getNumCities()):
ppCity = pPlayer.getCity(iiCity)
if ( not ppCity.isHasReligion(pPlayer.getStateReligion()) ):
lppCityUber5.append(ppCity)
if ( len(lppCityUber5) != 0 ):
chance = CyGame().getSorenRandNum(len(lppCityUber5), "which city")
ppCity = lppCityUber5[chance]
ppCity.setHasReligion(pPlayer.getStateReligion(), true, true, true)
## Crusade End ##
def onBuildingBuilt(self, argsList):
'Building Completed'
pCity, iBuildingType = argsList
game = gc.getGame()
### Crusade Start ###
if ( iBuildingType == gc.getInfoTypeForString("BUILDING_CRUSADE") ):
pPlayer = gc.getPlayer(pCity.plot().getOwner())
iPID = pPlayer.getID()
iTID = pPlayer.getTeam()
iX = pCity.getX()
iY = pCity.getY()
u_crusader = gc.getInfoTypeForString( 'UNIT_CRUSADER' )
for i in range(1):
pNewUnit = pPlayer.initUnit( u_crusader, iX, iY, UnitAITypes.UNITAI_ATTACK_CITY, DirectionTypes.NO_DIRECTION )
### Crusade End ###
if ((not gc.getGame().isNetworkMultiPlayer()) and (pCity.getOwner() == gc.getGame().getActivePlayer()) and isWorldWonderClass(gc.getBuildingInfo(iBuildingType).getBuildingClassType())):
# If this is a wonder...
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
popupInfo.setData1(iBuildingType)
popupInfo.setData2(pCity.getID())
popupInfo.setData3(0)
popupInfo.setText(u"showWonderMovie")
popupInfo.addPopup(pCity.getOwner())
CvAdvisorUtils.buildingBuiltFeats(pCity, iBuildingType)
if (not self.__LOG_BUILDING):
return
CvUtil.pyPrint('%s was finished by Player %d Civilization %s'
%(PyInfo.BuildingInfo(iBuildingType).getDescription(), pCity.getOwner(), gc.getPlayer(pCity.getOwner()).getCivilizationDescription(0)))
I downloaded the:
-Sphinx
-GGB
-SOH
-HSC
-Colosseum
It recommends me open up with Firefox, but when I do, it just pops up again and leaving a blank tab. What should I do and once I do download it, where do I extract it to?
You should save the downloads on to your computer instead of opening them directly from the download.