LoneTraveller
Warlord
I'm trying to input the KGB mod to Merged Mod. I inspired myself with another thread that was dealing with merging 2 eventManager (http://forums.civfanatics.com/showthread.php?t=352212&highlight=eventManager). Now I can start the mod and a scenario but when I make the necessary to make the event fire I get the following error message under the progress bar of the great general and people :
Error in unitBuilt event handler <bound methode BuildUnitName.onUnitBuilt of <UnitNameEventManager.BuildUnitName object at 0x4867e8b0
I figure this error is from a class called KGB and the ''onUnitBuilt'' is defined like this :
If anyone could see the problem I would appreciate it.
Spoiler :
Error in unitBuilt event handler <bound methode BuildUnitName.onUnitBuilt of <UnitNameEventManager.BuildUnitName object at 0x4867e8b0
I figure this error is from a class called KGB and the ''onUnitBuilt'' is defined like this :
Spoiler :
def onUnitBuilt(self, argsList):
'Unit Completed'
pCity = argsList[0]
pUnit = argsList[1]
pPlayer = gc.getPlayer(pUnit.plot().getOwner())
#f = open('C:\Users\LoneTralever\Documents\My Games\Beyond the Sword\Logs\KGB_onUnit_Built.txt', 'a')
#string = str(gc.getInfoTypeForString( 'BUILDING_KGB' ))
#f.write('KGB getInfotypeForString : ')
#f.write(string)
#f.write('\n')
#f.close()
if ( pUnit.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_SPY") ):
### check all cities ###
KGB = false
for iCity in range(pPlayer.getNumCities()):
if KGB == false:
pCity = pPlayer.getCity(iCity)
### if the player has the kgb wonder: give new build spies the sentry promotion ###
if pCity.getNumActiveBuilding(gc.getInfoTypeForString( 'BUILDING_KGB' )) == true:
KGB = true
p_sentry = gc.getInfoTypeForString( 'PROMOTION_RADAR_VISION1' )
pUnit.setHasPromotion(p_sentry, true)
### Ausgabe ###
### 1939 Modification Start, It was:
###CyInterface().addMessage(pPlayer.getID(),false,15,CyTranslator().getText("TXT_KEY_KGB_GAMETXT2",(pCity.getName(),PyHelpers.PyInfo.UnitInfo(pUnit.getUnitType()).getDescription())),'',0,gc.getPromotionInfo(p_sentry).getButton(),ColorTypes(44), pCity.getX(), pCity.getY(),True,True)
### It is:
CyInterface().addMessage(pPlayer.getID(),false,15,CyTranslator().getText("TXT_KEY_KGB_GAMETXT2",(pCity.getName(),PyHelpers.PyInfo.UnitInfo(pUnit.getUnitType()).getDescription())),'',0,'Art/Interface/Buttons/Promotions/radar_1.dds',ColorTypes(44), pCity.getX(), pCity.getY(),True,True)
### 1939 Modificaton End
### message: In %s the KGB Wonder provides a free Radar Vision Promotion to your new build %s! ###
'Unit Completed'
pCity = argsList[0]
pUnit = argsList[1]
pPlayer = gc.getPlayer(pUnit.plot().getOwner())
#f = open('C:\Users\LoneTralever\Documents\My Games\Beyond the Sword\Logs\KGB_onUnit_Built.txt', 'a')
#string = str(gc.getInfoTypeForString( 'BUILDING_KGB' ))
#f.write('KGB getInfotypeForString : ')
#f.write(string)
#f.write('\n')
#f.close()
if ( pUnit.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_SPY") ):
### check all cities ###
KGB = false
for iCity in range(pPlayer.getNumCities()):
if KGB == false:
pCity = pPlayer.getCity(iCity)
### if the player has the kgb wonder: give new build spies the sentry promotion ###
if pCity.getNumActiveBuilding(gc.getInfoTypeForString( 'BUILDING_KGB' )) == true:
KGB = true
p_sentry = gc.getInfoTypeForString( 'PROMOTION_RADAR_VISION1' )
pUnit.setHasPromotion(p_sentry, true)
### Ausgabe ###
### 1939 Modification Start, It was:
###CyInterface().addMessage(pPlayer.getID(),false,15,CyTranslator().getText("TXT_KEY_KGB_GAMETXT2",(pCity.getName(),PyHelpers.PyInfo.UnitInfo(pUnit.getUnitType()).getDescription())),'',0,gc.getPromotionInfo(p_sentry).getButton(),ColorTypes(44), pCity.getX(), pCity.getY(),True,True)
### It is:
CyInterface().addMessage(pPlayer.getID(),false,15,CyTranslator().getText("TXT_KEY_KGB_GAMETXT2",(pCity.getName(),PyHelpers.PyInfo.UnitInfo(pUnit.getUnitType()).getDescription())),'',0,'Art/Interface/Buttons/Promotions/radar_1.dds',ColorTypes(44), pCity.getX(), pCity.getY(),True,True)
### 1939 Modificaton End
### message: In %s the KGB Wonder provides a free Radar Vision Promotion to your new build %s! ###
If anyone could see the problem I would appreciate it.