Fanatic Noob
King of Noobism
I see you dont like to brag, HUH![]()
Well, I just made impossible, porting my nation, from RoM to C2C as possible, so it's just my random happines, nothing about bragging ; ]
I see you dont like to brag, HUH![]()
Traceback (most recent call last):
File "CvScreensInterface", line 464 in pediaJumptoBuilding
File "SevoPediaMain", line 293, in pediaJump
File "SevoPediaBuilding", line 78, in interfaceScreen
Runtime error: unidentifiable C++ exception
city.changeCulture(unitStr, false)
I would hope that you are not actually missing the first argument to the call, the one that specifies which player's culture is getting added...
from CvPythonExtensions import *
from PyHelpers import PyPlayer
import CvUtil
import sys
# globals
gc = CyGlobalContext()
bc_Alamo = gc.getInfoTypeForString("BUILDINGCLASS_ALAMO")
def onUnitKilled(argsList):
unit, iAttacker = argsList
player = PyPlayer(unit.getOwner())
if player.getBuildingClassCount(bc_Alamo) == 1:
unitStr = unit.baseCombatStr()
cityList = player.getCityList()
for city in cityList:
city.changeCulture(unitStr, False)
TypeError: changeCulture() takes at most 3 arguments (4 given)
If the bPlots argument is set to True it will run some code that distributes culture to plots in the city's cultural radius like it normally does just once per turn, although with a quick look at the code it appears that it is checking for a city's workable plots (it checks the range via CvPlot::isPotentialCityWorkForArea isntead of CvPlot::isWithinCultureRange) so it appears to only do this for plots in the city's workable area (the 3x3 area centered on the city if its borders have not expanded, or the full BFC if they have expanded at least once) rather than the full cultural radius. The amount of culture it adds to each plot is always the minimum value (the function that distributes the culture is called with a amount value of 0), which is 1 + the base amount (call it "B", the CITY_FREE_CULTURE_GROWTH_FACTOR defined value) multiplied by the culture level (call it "C") minus the range ("R"), as in B*(C-R) + 1. That value "B" is normally 20 and the value of R will be 0 for the city plot itself, 1 for adjacent plots and 2 for the remaining plots that make up the BFC. The amount of culture you are adding to the city does not affect this. It would pretty much be a free distribution of some amount of culture to all the affected plots beyond the normal amount they get during the processing between turns.
You probably don't want to set it to True. The one example I see (from just a quick search in the CvCity.cpp file) that does use True happens when a city is liberated, so when a city is liberated it immediately gets some of its new civ's culture spread around and then it will get the regular amount on its turns as usual after that.
This is what the code looks like:
Code:from CvPythonExtensions import * from PyHelpers import PyPlayer import CvUtil import sys # globals gc = CyGlobalContext() bc_Alamo = gc.getInfoTypeForString("BUILDINGCLASS_ALAMO") def onUnitKilled(argsList): unit, iAttacker = argsList player = PyPlayer(unit.getOwner()) if player.getBuildingClassCount(bc_Alamo) == 1: unitStr = unit.baseCombatStr() cityList = player.getCityList() for city in cityList: city.changeCulture(unitStr, False)
If I add anything else to the city.changeCulture line, I get this error:
Code:TypeError: changeCulture() takes at most 3 arguments (4 given)
It looks to me like the changeCulture is already using player as its first argument. I could be wrong - is there something going on that I'm not aware of?
void CyCity::changeCulture(int /*PlayerTypes*/ eIndex, int iChange, bool bPlots)
.def("changeCulture", &CyCity::changeCulture, "void (int PlayerTypes eIndex, int iChange, bool bPlots)")
I think thjis is a bug in the (exposure of the) method being exposed to Python. The code has:
but the def that exposes it to Python is:Code:void CyCity::changeCulture(int /*PlayerTypes*/ eIndex, int iChange, bool bPlots)
The 'PlayerTypes' part should no be there (just the 'int' since the (actual) PlayerTypes enum is not a Python type and should just be a comment).Code:.def("changeCulture", &CyCity::changeCulture, "void (int PlayerTypes eIndex, int iChange, bool bPlots)")
I have just fixed this in SVN rev 3196 - let me know if you can use the (correct) 3 arguments now please.
city.changeCulture(player, unitStr, False)
city.changeCulture(unitStr, False)
No, I'm still getting the error message, and I updated my SVN to 3196.
This produces the TypeError message of 4 arguments:
Code:city.changeCulture(player, unitStr, True)
This produces no error message and (apparently) the correct culture adjustment:
Code:city.changeCulture(unitStr, True)
Do you want my module files?
Eh, that third part of the .def is just a help comment for Python as string, it has no meaning for the actual call.I think thjis is a bug in the (exposure of the) method being exposed to Python. The code has:
but the def that exposes it to Python is:Code:void CyCity::changeCulture(int /*PlayerTypes*/ eIndex, int iChange, bool bPlots)
The 'PlayerTypes' part should no be there (just the 'int' since the (actual) PlayerTypes enum is not a Python type and should just be a comment).Code:.def("changeCulture", &CyCity::changeCulture, "void (int PlayerTypes eIndex, int iChange, bool bPlots)")
I have just fixed this in SVN rev 3196 - let me know if you can use the (correct) 3 arguments now please.
Eh, that third part of the .def is just a help comment for Python as string, it has no meaning for the actual call.
Hmm, I think what he is calling is PyCity.changeCulture, not CyCity.changeCulture.Ok - thought the interpretor was using it to param check. In that case it's a mystery currently why Volkarya can't use all three params.
Hmm, I think what he is calling is PyCity.changeCulture, not CyCity.changeCulture.
It is a Python function with that signature: def changeCulture(self, iChange, bPlots=True)
Ah yes. That's fine then - it does indeed assume you mean the city owner as the player.
OK, then: should I change my code or leave it the way it is now?
Its fine now I think.
pPlayer = gc.getPlayer(pWinner.getOwner())
if pWinner.isHasPromotion(gc.getInfoTypeForString('RETINUE_MERCHANT')):
pPlayer = gc.getPlayer(pWinner.getOwner())
#~ pPlayer = gc.getPlayer(pWinner.getOwner())
if pWinner.isHasPromotion(gc.getInfoTypeForString('RETINUE_MERCHANT')):
#~ pPlayer = gc.getPlayer(pWinner.getOwner())
Python problem"
whats the difference between the two and which one or do i change to make it work correctly?
Spoiler :Code:pPlayer = gc.getPlayer(pWinner.getOwner()) if pWinner.isHasPromotion(gc.getInfoTypeForString('RETINUE_MERCHANT')): pPlayer = gc.getPlayer(pWinner.getOwner())
or
?Spoiler :Code:#~ pPlayer = gc.getPlayer(pWinner.getOwner()) if pWinner.isHasPromotion(gc.getInfoTypeForString('RETINUE_MERCHANT')): #~ pPlayer = gc.getPlayer(pWinner.getOwner())
Neither of them make sense!
The first one is valid Python but does absolutely nothing (sets player to X, then IF <promotion condition> set it to the same X again, so the conditional is irrelevant).
The second one is invalid Python since the 'if' has no statement to execute due to it havign been commented out
## Marauder part 1Start ##
#~ pPlayer = gc.getPlayer(pWinner.getOwner())
if pWinner.isHasPromotion(gc.getInfoTypeForString('PROMOTION_MARAUDER')):
#~ pPlayer = gc.getPlayer(pWinner.getOwner())
iGold = playerY.getGold( )
message = 0
iGoldStolen = ( iGold//25 )
if playerY.getGold( ) >= 500:
playerY.changeGold( -20 )
elif playerY.getGold( ) >= 25:
playerY.changeGold( -iGoldStolen )
elif (playerY.getGold( ) >= 1) and (playerY.getGold( ) < 25):
playerY.changeGold( -1 )
iGold2 = playerX.getGold( )
if playerY.getGold( ) >= 500:
playerX.changeGold( +20 )
message = 1
elif playerY.getGold( ) >= 25:
playerX.changeGold( +iGoldStolen )
message = 2
else:
playerX.changeGold( +1 )
message = 3
pPID = pPlayer.getID()
iX = pWinner.getX()
iY = pWinner.getY()
szName = pPlayer.getName()
## This only controls the text, all actual gold amounts are done above:
iGoldStolenMax = ( 500//25 )
iGoldStolenMin = ( 25//25 )
if ( message == 1 ):
CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_MARAUDER_GOLD1",(szName,iGoldStolenMax)),'',0,',Art/Interface/Buttons/TechTree/Banking.dds,Art/Interface/Buttons/TechTree_Atlas.dds,8,1',ColorTypes(44), iX, iY, True,True)
CyInterface().addMessage(pLoser.getOwner(),false,15,CyTranslator().getText("TXT_KEY_MARAUDER_GOLD1",(szName,iGoldStolenMax)),'',0,',Art/Interface/Buttons/TechTree/Banking.dds,Art/Interface/Buttons/TechTree_Atlas.dds,8,1',ColorTypes(44), iX, iY, True,True)
### message: %s1 has plundered %d2 [ICON_GOLD]!###
if ( message == 2 ):
CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_MARAUDER_GOLD2",(szName,iGoldStolen)),'',0,',Art/Interface/Buttons/TechTree/Banking.dds,Art/Interface/Buttons/TechTree_Atlas.dds,8,1',ColorTypes(44), iX, iY, True,True)
CyInterface().addMessage(pLoser.getOwner(),false,15,CyTranslator().getText("TXT_KEY_MARAUDER_GOLD2",(szName,iGoldStolen)),'',0,',Art/Interface/Buttons/TechTree/Banking.dds,Art/Interface/Buttons/TechTree_Atlas.dds,8,1',ColorTypes(44), iX, iY, True,True)
### message: %s1 has plundered %d2 [ICON_GOLD]!###
if ( message == 3 ):
CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_MARAUDER_GOLD3",(szName,iGoldStolenMin)),'',0,',Art/Interface/Buttons/TechTree/Banking.dds,Art/Interface/Buttons/TechTree_Atlas.dds,8,1',ColorTypes(44), iX, iY, True,True)
CyInterface().addMessage(pLoser.getOwner(),false,15,CyTranslator().getText("TXT_KEY_MARAUDER_GOLD3",(szName,iGoldStolenMin)),'',0,',Art/Interface/Buttons/TechTree/Banking.dds,Art/Interface/Buttons/TechTree_Atlas.dds,8,1',ColorTypes(44), iX, iY, True,True)
### message: %s1 has plundered %d2 [ICON_GOLD]!###
## Marauder part 1 End ##
## Industry Espionage Part 1 Start ##
if pWinner.isHasPromotion(gc.getInfoTypeForString('PROMOTION_INDUSTRYESPIONAGE')) and gc.getPlayer(pLoser.getOwner()).getCurrentResearch()>=0:
pPlayer = gc.getPlayer(pWinner.getOwner())
myteamINT = pPlayer.getTeam()
myteam = gc.getTeam(myteamINT)
otherplayerINT =pLoser.getOwner()
otherplayer = gc.getPlayer(otherplayerINT)
otherteamINT=otherplayer.getTeam()
otherteam=gc.getTeam(otherteamINT)
iResearch = otherplayer.calculateBaseNetResearch ()
iResearchStolen = ( iResearch/25 )
if iResearch >= 500:
myteam.changeResearchProgress(pPlayer.getCurrentResearch (),20,pWinner.getOwner())
otherteam.changeResearchProgress(otherplayer.getCurrentResearch (),-20,pLoser.getOwner())
message = 1
elif iResearch >= 25:
myteam.changeResearchProgress(pPlayer.getCurrentResearch (),iResearchStolen,pWinner.getOwner())
otherteam.changeResearchProgress(otherplayer.getCurrentResearch (),-iResearchStolen,pLoser.getOwner())
message = 2
else:
myteam.changeResearchProgress(pPlayer.getCurrentResearch (),1,pWinner.getOwner())
otherteam.changeResearchProgress(otherplayer.getCurrentResearch (),-1,pLoser.getOwner())
message = 3
pPID = pPlayer.getID()
otherPID=otherplayer.getID()
iX = pWinner.getX()
iY = pWinner.getY()
szName = pPlayer.getName()
## This only controls the text, all actual gold amounts are done above:
iGoldStolenMax = ( 500//25 )
iGoldStolenMin = ( 25//25 )
if ( message == 1 ):
CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_INDUSTRYESPIONAGE1",(szName,iGoldStolenMax)),'',0,'Art/Interface/Buttons/Process/ProcessResearch.dds',ColorTypes(44), iX, iY, True,True)
CyInterface().addMessage(otherPID,false,15,CyTranslator().getText("TXT_KEY_INDUSTRYESPIONAGE1",(szName,iGoldStolenMax)),'',0,'Art/Interface/Buttons/Process/ProcessResearch.dds',ColorTypes(44), iX, iY, True,True)
### message: %s1 has plundered %d2 [ICON_GOLD]!###
if ( message == 2 ):
CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_INDUSTRYESPIONAGE2",(szName,iResearchStolen)),'',0,'Art/Interface/Buttons/Process/ProcessResearch.dds',ColorTypes(44), iX, iY, True,True)
CyInterface().addMessage(otherPID,false,15,CyTranslator().getText("TXT_KEY_INDUSTRYESPIONAGE2",(szName,iResearchStolen)),'',0,'Art/Interface/Buttons/Process/ProcessResearch.dds',ColorTypes(44), iX, iY, True,True)
### message: %s1 has plundered %d2 [ICON_GOLD]!###
if ( message == 3 ):
CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_INDUSTRYESPIONAGE3",(szName,iGoldStolenMin)),'',0,'Art/Interface/Buttons/Process/ProcessResearch.dds',ColorTypes(44), iX, iY, True,True)
CyInterface().addMessage(otherPID,false,15,CyTranslator().getText("TXT_KEY_INDUSTRYESPIONAGE3",(szName,iGoldStolenMin)),'',0,'Art/Interface/Buttons/Process/ProcessResearch.dds',ColorTypes(44), iX, iY, True,True)
### message: %s1 has plundered %d2 [ICON_GOLD]!###
## Industry Espionage Part 1 End ##
###Marauder Part 2 AI start###
#~ pWinner = pUnit
#~ pPlayer = gc.getPlayer(pWinner.getOwner())
#~ if not pPlayer.isHuman():
iMarauderPromo = gc.getInfoTypeForString('PROMOTION_MARAUDER')
if (iPromotion<>iMarauderPromo):
if not pWinner.isHasPromotion(iMarauderPromo):
if pWinner.canAcquirePromotion(iMarauderPromo):
if ((pPlayer.getGoldPerTurn () <=10)or(pPlayer.getCommercePercent(gc.getInfoTypeForString("COMMERCE_GOLD")) >=30)):
descission = CyGame().getSorenRandNum(4, "Gold")
if ((descission==1) or (descission ==2)):
if pWinner.canAcquirePromotion(iMarauderPromo):
pWinner.setHasPromotion(iPromotion,False)
pWinner.setHasPromotion(iMarauderPromo,True)
return
###Marauder Part 2 AI End###
###Industry Espionage Part 2 AI start###
#~ pWinner = pUnit
#~ pPlayer = gc.getPlayer(pWinner.getOwner())
#~ if not pPlayer.isHuman():
iIndusPromo = gc.getInfoTypeForString('PROMOTION_INDUSTRYESPIONAGE')
if (iPromotion<>iIndusPromo):
if not pWinner.isHasPromotion(iIndusPromo):
if pWinner.canAcquirePromotion(iIndusPromo):
if (pPlayer.getCommercePercent(gc.getInfoTypeForString("COMMERCE_RESEARCH")) <=70):
descission = CyGame().getSorenRandNum(4, "Research")
if ((descission==1) or (descission ==2)):
pWinner.setHasPromotion(iPromotion,False)
if pWinner.canAcquirePromotion(iIndusPromo):
pWinner.setHasPromotion(iIndusPromo,True)
else:
pWinner.setHasPromotion(iPromotion,True)
return
###Industry Espionage Part 2 AI End###
OK here is what i have then, pls change it to make it work, thx:
Part 1:
Spoiler :Code:## Marauder part 1Start ## #~ pPlayer = gc.getPlayer(pWinner.getOwner()) if pWinner.isHasPromotion(gc.getInfoTypeForString('PROMOTION_MARAUDER')): #~ pPlayer = gc.getPlayer(pWinner.getOwner()) iGold = playerY.getGold( ) message = 0 iGoldStolen = ( iGold//25 ) if playerY.getGold( ) >= 500: playerY.changeGold( -20 ) elif playerY.getGold( ) >= 25: playerY.changeGold( -iGoldStolen ) elif (playerY.getGold( ) >= 1) and (playerY.getGold( ) < 25): playerY.changeGold( -1 ) iGold2 = playerX.getGold( ) if playerY.getGold( ) >= 500: playerX.changeGold( +20 ) message = 1 elif playerY.getGold( ) >= 25: playerX.changeGold( +iGoldStolen ) message = 2 else: playerX.changeGold( +1 ) message = 3 pPID = pPlayer.getID() iX = pWinner.getX() iY = pWinner.getY() szName = pPlayer.getName() ## This only controls the text, all actual gold amounts are done above: iGoldStolenMax = ( 500//25 ) iGoldStolenMin = ( 25//25 ) if ( message == 1 ): CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_MARAUDER_GOLD1",(szName,iGoldStolenMax)),'',0,',Art/Interface/Buttons/TechTree/Banking.dds,Art/Interface/Buttons/TechTree_Atlas.dds,8,1',ColorTypes(44), iX, iY, True,True) CyInterface().addMessage(pLoser.getOwner(),false,15,CyTranslator().getText("TXT_KEY_MARAUDER_GOLD1",(szName,iGoldStolenMax)),'',0,',Art/Interface/Buttons/TechTree/Banking.dds,Art/Interface/Buttons/TechTree_Atlas.dds,8,1',ColorTypes(44), iX, iY, True,True) ### message: %s1 has plundered %d2 [ICON_GOLD]!### if ( message == 2 ): CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_MARAUDER_GOLD2",(szName,iGoldStolen)),'',0,',Art/Interface/Buttons/TechTree/Banking.dds,Art/Interface/Buttons/TechTree_Atlas.dds,8,1',ColorTypes(44), iX, iY, True,True) CyInterface().addMessage(pLoser.getOwner(),false,15,CyTranslator().getText("TXT_KEY_MARAUDER_GOLD2",(szName,iGoldStolen)),'',0,',Art/Interface/Buttons/TechTree/Banking.dds,Art/Interface/Buttons/TechTree_Atlas.dds,8,1',ColorTypes(44), iX, iY, True,True) ### message: %s1 has plundered %d2 [ICON_GOLD]!### if ( message == 3 ): CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_MARAUDER_GOLD3",(szName,iGoldStolenMin)),'',0,',Art/Interface/Buttons/TechTree/Banking.dds,Art/Interface/Buttons/TechTree_Atlas.dds,8,1',ColorTypes(44), iX, iY, True,True) CyInterface().addMessage(pLoser.getOwner(),false,15,CyTranslator().getText("TXT_KEY_MARAUDER_GOLD3",(szName,iGoldStolenMin)),'',0,',Art/Interface/Buttons/TechTree/Banking.dds,Art/Interface/Buttons/TechTree_Atlas.dds,8,1',ColorTypes(44), iX, iY, True,True) ### message: %s1 has plundered %d2 [ICON_GOLD]!### ## Marauder part 1 End ## ## Industry Espionage Part 1 Start ## if pWinner.isHasPromotion(gc.getInfoTypeForString('PROMOTION_INDUSTRYESPIONAGE')) and gc.getPlayer(pLoser.getOwner()).getCurrentResearch()>=0: pPlayer = gc.getPlayer(pWinner.getOwner()) myteamINT = pPlayer.getTeam() myteam = gc.getTeam(myteamINT) otherplayerINT =pLoser.getOwner() otherplayer = gc.getPlayer(otherplayerINT) otherteamINT=otherplayer.getTeam() otherteam=gc.getTeam(otherteamINT) iResearch = otherplayer.calculateBaseNetResearch () iResearchStolen = ( iResearch/25 ) if iResearch >= 500: myteam.changeResearchProgress(pPlayer.getCurrentResearch (),20,pWinner.getOwner()) otherteam.changeResearchProgress(otherplayer.getCurrentResearch (),-20,pLoser.getOwner()) message = 1 elif iResearch >= 25: myteam.changeResearchProgress(pPlayer.getCurrentResearch (),iResearchStolen,pWinner.getOwner()) otherteam.changeResearchProgress(otherplayer.getCurrentResearch (),-iResearchStolen,pLoser.getOwner()) message = 2 else: myteam.changeResearchProgress(pPlayer.getCurrentResearch (),1,pWinner.getOwner()) otherteam.changeResearchProgress(otherplayer.getCurrentResearch (),-1,pLoser.getOwner()) message = 3 pPID = pPlayer.getID() otherPID=otherplayer.getID() iX = pWinner.getX() iY = pWinner.getY() szName = pPlayer.getName() ## This only controls the text, all actual gold amounts are done above: iGoldStolenMax = ( 500//25 ) iGoldStolenMin = ( 25//25 ) if ( message == 1 ): CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_INDUSTRYESPIONAGE1",(szName,iGoldStolenMax)),'',0,'Art/Interface/Buttons/Process/ProcessResearch.dds',ColorTypes(44), iX, iY, True,True) CyInterface().addMessage(otherPID,false,15,CyTranslator().getText("TXT_KEY_INDUSTRYESPIONAGE1",(szName,iGoldStolenMax)),'',0,'Art/Interface/Buttons/Process/ProcessResearch.dds',ColorTypes(44), iX, iY, True,True) ### message: %s1 has plundered %d2 [ICON_GOLD]!### if ( message == 2 ): CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_INDUSTRYESPIONAGE2",(szName,iResearchStolen)),'',0,'Art/Interface/Buttons/Process/ProcessResearch.dds',ColorTypes(44), iX, iY, True,True) CyInterface().addMessage(otherPID,false,15,CyTranslator().getText("TXT_KEY_INDUSTRYESPIONAGE2",(szName,iResearchStolen)),'',0,'Art/Interface/Buttons/Process/ProcessResearch.dds',ColorTypes(44), iX, iY, True,True) ### message: %s1 has plundered %d2 [ICON_GOLD]!### if ( message == 3 ): CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_INDUSTRYESPIONAGE3",(szName,iGoldStolenMin)),'',0,'Art/Interface/Buttons/Process/ProcessResearch.dds',ColorTypes(44), iX, iY, True,True) CyInterface().addMessage(otherPID,false,15,CyTranslator().getText("TXT_KEY_INDUSTRYESPIONAGE3",(szName,iGoldStolenMin)),'',0,'Art/Interface/Buttons/Process/ProcessResearch.dds',ColorTypes(44), iX, iY, True,True) ### message: %s1 has plundered %d2 [ICON_GOLD]!### ## Industry Espionage Part 1 End ##
part 2:
Spoiler :Code:###Marauder Part 2 AI start### #~ pWinner = pUnit #~ pPlayer = gc.getPlayer(pWinner.getOwner()) #~ if not pPlayer.isHuman(): iMarauderPromo = gc.getInfoTypeForString('PROMOTION_MARAUDER') if (iPromotion<>iMarauderPromo): if not pWinner.isHasPromotion(iMarauderPromo): if pWinner.canAcquirePromotion(iMarauderPromo): if ((pPlayer.getGoldPerTurn () <=10)or(pPlayer.getCommercePercent(gc.getInfoTypeForString("COMMERCE_GOLD")) >=30)): descission = CyGame().getSorenRandNum(4, "Gold") if ((descission==1) or (descission ==2)): if pWinner.canAcquirePromotion(iMarauderPromo): pWinner.setHasPromotion(iPromotion,False) pWinner.setHasPromotion(iMarauderPromo,True) return ###Marauder Part 2 AI End### ###Industry Espionage Part 2 AI start### #~ pWinner = pUnit #~ pPlayer = gc.getPlayer(pWinner.getOwner()) #~ if not pPlayer.isHuman(): iIndusPromo = gc.getInfoTypeForString('PROMOTION_INDUSTRYESPIONAGE') if (iPromotion<>iIndusPromo): if not pWinner.isHasPromotion(iIndusPromo): if pWinner.canAcquirePromotion(iIndusPromo): if (pPlayer.getCommercePercent(gc.getInfoTypeForString("COMMERCE_RESEARCH")) <=70): descission = CyGame().getSorenRandNum(4, "Research") if ((descission==1) or (descission ==2)): pWinner.setHasPromotion(iPromotion,False) if pWinner.canAcquirePromotion(iIndusPromo): pWinner.setHasPromotion(iIndusPromo,True) else: pWinner.setHasPromotion(iPromotion,True) return ###Industry Espionage Part 2 AI End###