Hi,
I merged the "war machines" code from Platy into Bug Mod. it is working so far. Now I try to show a message like "unit %s was finished with +1XP by Player %d Civilization %s"
but I get always Python errors.
thats the code working:
def onUnitBuilt(self, argsList):
'Unit Completed'
city = argsList[0]
unit = argsList[1]
player = PyPlayer(city.getOwner())
## Training Center ##
if unit.getUnitCombatType() > -1:
iTrainRatio = 10 ## 1 XP per 10 of this unit built
iCount = CyStatistics().getPlayerNumUnitsBuilt(city.getOwner(), unit.getUnitType())
unit.changeExperience(iCount / iTrainRatio, 99999, False, False, False)
now I like to add this:
CvUtil.pyPrint('unit %s was finished with +1XP by Player %d in' %(pCity.getName()))
Any idea ?
I merged the "war machines" code from Platy into Bug Mod. it is working so far. Now I try to show a message like "unit %s was finished with +1XP by Player %d Civilization %s"
but I get always Python errors.
thats the code working:
def onUnitBuilt(self, argsList):
'Unit Completed'
city = argsList[0]
unit = argsList[1]
player = PyPlayer(city.getOwner())
## Training Center ##
if unit.getUnitCombatType() > -1:
iTrainRatio = 10 ## 1 XP per 10 of this unit built
iCount = CyStatistics().getPlayerNumUnitsBuilt(city.getOwner(), unit.getUnitType())
unit.changeExperience(iCount / iTrainRatio, 99999, False, False, False)
now I like to add this:
CvUtil.pyPrint('unit %s was finished with +1XP by Player %d in' %(pCity.getName()))
Any idea ?