Bad Player
Deity
Hi, I'm making a FFH2 civilisation called Illians produce a project called SAMHAIN. The code forces it to be built even though the program doesn't believe that it should be allowed to be built (it is buildable at the start of the game by the Illians when I play as the Illians so I don't understand that problem either!).
The code sort of works meaning that the SAMHAIN project is the current build item for the Illians' capital city and the setProduction gives it all the hammers to finish the project (400 hammers) and makes the build bar full when I view it in worldbuilder. However, the city never finishes/completes the project and I don't know why!!??
The code sort of works meaning that the SAMHAIN project is the current build item for the Illians' capital city and the setProduction gives it all the hammers to finish the project (400 hammers) and makes the build bar full when I view it in worldbuilder. However, the city never finishes/completes the project and I don't know why!!??
Code:
for iPlayer in range(gc.getMAX_PLAYERS()):
pTargetPlayer = gc.getPlayer(iPlayer)
if pTargetPlayer.isAlive():
for pyCity in PyPlayer(iPlayer).getCityList():
pTargetCity = pyCity.GetCy()
if pTargetCity.isCapital():
#if iGameTurn == 3:
#cf.addUnit(gc.getInfoTypeForString('UNIT_HUNTER'))
if not pTargetPlayer.isHuman():
if pTargetPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_ILLIANS'):
#if pTargetCity.canCreate(gc.getInfoTypeForString('PROJECT_SAMHAIN'), True, True):
pTargetCity.pushOrder(OrderTypes.ORDER_CREATE, gc.getInfoTypeForString('PROJECT_SAMHAIN'), -1, False, False, False, True)
pTargetCity.setProduction(400)
return 1