Merkava120
Oberleutnant
I'm trying to make it so that whenever I build a certain unit, another spawns, i.e. building an army all at once instead of just one unit at a time. Nothing's happening though.
I don't know enough about python to know what's happening (or rather, what isn't happening). Could someone enlighten me?
Code:
def onUnitBuilt(self, argsList):
'Unit Completed'
city = argsList[0]
unit = argsList[1]
player = PyPlayer(city.getOwner())
## Armies ##
int iUnitID = CvUtil.findInfoTypeNum(gc.getUnitInfo, gc.getNumUnitInfos(), 'UNIT_INFANTRY')
if unit.getUnitType() == iUnitID:
initUnit(iUnitID,city.getX(),city.getY(),UnitAITypes.NO_UNITAI)
## Armies ##
CvAdvisorUtils.unitBuiltFeats(city, unit)
I don't know enough about python to know what's happening (or rather, what isn't happening). Could someone enlighten me?