The Capo
godless Heathen
Hey, I'm working on this mod and I am in the process of playtesting it and getting rid of bugs, but there is one I don't know how to fix. It looks like its simple though, but I don't have a lot of python experience. Anyway the problem seems to arise with the AI either building, or deciding to build, an Inquisitor unit. Here is the Python error message;
file "CvGameInterface", line 180, in AI_chooseProduction
file "CVGameUtils", line 269, in AI_chooseProduction
TypeError: 'NoneType' object is not callable
Alright, well in the mod I am using I don't have a CvGameInterface.py file, so I assume that refers to the vanilla BtS file. Here is the code surrounding and including line 180:
In my mod this is the code I have surrounding and including line 180 in the CvGameUtils.py file:
Line 269 in this (the one in question) is the line that says:
Can anybody help me with this?
file "CvGameInterface", line 180, in AI_chooseProduction
file "CVGameUtils", line 269, in AI_chooseProduction
TypeError: 'NoneType' object is not callable
Alright, well in the mod I am using I don't have a CvGameInterface.py file, so I assume that refers to the vanilla BtS file. Here is the code surrounding and including line 180:
Code:
def AI_chooseProduction(argsList):
'AI chooses city production'
#CvUtil.pyPrint( "CvGameInterface.AI_chooseProduction" )
return gameUtils().AI_chooseProduction(argsList)
In my mod this is the code I have surrounding and including line 180 in the CvGameUtils.py file:
Code:
if not iStateReligion == -1 :
#if gc.getPlayer( iOwner ).getStateReligion( ) >= 0:
if pCity.canTrain( iTaoInq, 0, 0 ) or pCity.canTrain( iConInq, 0, 0 ) or pCity.canTrain( iJudInq, 0, 0 ) or pCity.canTrain( iHinInq, 0, 0 ) or pCity.canTrain( iBudInq, 0, 0 ) or pCity.canTrain( iIslInq, 0, 0 ) or pCity.canTrain( iChrInq, 0, 0 ) or pCity.canTrain( iOlyInq, 0, 0 ) or pCity.canTrain( iAseInq, 0, 0 ) or pCity.canTrain( iVooInq, 0, 0 ) or pCity.canTrain( iShiInq, 0, 0 ) or pCity.canTrain( iZorInq, 0, 0 ) or pCity.canTrain( iRaaInq, 0, 0 ) or pCity.canTrain( iTolInq, 0, 0 ):
lUnits = PyPlayer( pPlayer.getID( ) ).getUnitList( )
for iUnit in range( len( lUnits) ):
# if there are any Inquisitors, don't Build one
if pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iJudInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iChrInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iIslInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iHinInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iBudInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iConInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iTaoInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iOlyInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iAseInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iVooInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iShiInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iZorInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iRaaInq or pPlayer.getUnit( lUnits[ iUnit ].getID( ) ).getUnitType( ) == iTolInq:
return False
if self.getRandomNumber( 2 ) == 0:
iInqVersions = { "1": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iJudInq, -1, False, False, False, True ), "2": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iChrInq, -1, False, False, False, True ), "3": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iIslInq, -1, False, False, False, True ), "4": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iHinInq, -1, False, False, False, True ), "5": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iBudInq, -1, False, False, False, True ), "6": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iConInq, -1, False, False, False, True ), "7": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iTaoInq, -1, False, False, False, True ), "8": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iOlyInq, -1, False, False, False, True ), "9": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iAseInq, -1, False, False, False, True ), "10": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iVooInq, -1, False, False, False, True ), "11": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iShiInq, -1, False, False, False, True ), "12": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iZorInq, -1, False, False, False, True ), "13": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iRaaInq, -1, False, False, False, True ), "14": gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_TRAIN, iTolInq, -1, False, False, False, True )}
iInqVersions.get( pPlayer.getStateReligion( ), ) ()
return True
return False
Line 269 in this (the one in question) is the line that says:
Code:
iInqVersions.get( pPlayer.getStateReligion( ), ) ()
Can anybody help me with this?