I've posted this somewhere else but maybe someone here can help.
I liked The J's idea of adding python "AI" to tsentoms old python promotion. However I decided to toy around and try to improve the functions, focusing on what type of AI the unit is.
However I ran into some problems with the function: getUnitAIType
I put the following code in under onUnitPromoted(self, argsList): in eventmanager.
however i got this error to occur on the line:
pWinner.getUnitAIType(gc.getInfoTypeForString('UNITAI_COUNTER')):
I was just wondering if anybody knows exactly what the problem is here? I sure cannot figure it out...
I liked The J's idea of adding python "AI" to tsentoms old python promotion. However I decided to toy around and try to improve the functions, focusing on what type of AI the unit is.
However I ran into some problems with the function: getUnitAIType
I put the following code in under onUnitPromoted(self, argsList): in eventmanager.
Code:
if not pPlayer.isHuman():
if (iPromotion<>gc.getInfoTypeForString('PROMOTION_SURVIVAL')):
if not pWinner.isHasPromotion(gc.getInfoTypeForString('PROMOTION_SURVIVAL')):
if pWinner.canAcquirePromotion(gc.getInfoTypeForString('PROMOTION_SURVIVAL')):
if pWinner.getUnitAIType(gc.getInfoTypeForString('UNITAI_COUNTER')):
dice = gc.getGame().getMapRand()
result = dice.get(4, "Gold")
if ((result==1) or (result ==2)):
pWinner.setHasPromotion(gc.getInfoTypeForString('PROMOTION_SURVIVAL'),True)
pWinner.setHasPromotion(iPromotion,False)
return
however i got this error to occur on the line:
pWinner.getUnitAIType(gc.getInfoTypeForString('UNITAI_COUNTER')):
Python Argument Types in CyUnit.getUnitAIType(CyUnit, str)
did not match C++ signature(class CyUnit {value})
I was just wondering if anybody knows exactly what the problem is here? I sure cannot figure it out...