Help Wanted Ads

I see you dont like to brag, HUH:banana:

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 have run into a new error with the Sevopedia and art files. I am working on a Woodstock Wonder (to use the new Counterculture tech) and I found a building model here: http://forums.civfanatics.com/downloads.php?do=file&id=18990. When I try to use the building model, I get an error from the Sevopedia when I go into the Wonder entry. Has anyone seen this error before, or know what causes it? I know it has to do with the building model, because if the ArtDefines file doesn't call the building NIF file, there is no problem. The NIF looks fine in NifSkope, so I don't know what the problem is.

This is what the error reads:

Code:
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

I've attached a ZIP of the current module. Please let me know if there is any way to get the building model usable. I suppose the wonder could work without the building model if that is the only way.
 
Quick question here. I'm working on an Alamo wonder that will add the base strength of any of your units killed as culture in all cities. This is the Python function that adds the culture to the cities:
Code:
city.changeCulture(unitStr, false)

What does the last parameter mean? I looked it up in the API and it just said BOOL bPlots. I have it set to False right now and it seems to work, but I just want to know what that parameter is doing.
 
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...

It may be a quick question, but the answer is not quite so quick.

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.
 
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...

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?
 
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.

OK. Thank you for the explanation. I will leave the parameter on False.
 
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?

I think thjis is a bug in the (exposure of the) method being exposed to Python. The code has:
Code:
void CyCity::changeCulture(int /*PlayerTypes*/ eIndex, int iChange, bool bPlots)
but the def that exposes it to Python is:
Code:
.def("changeCulture", &CyCity::changeCulture, "void (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).

I have just fixed this in SVN rev 3196 - let me know if you can use the (correct) 3 arguments now please.
 
I think thjis is a bug in the (exposure of the) method being exposed to Python. The code has:
Code:
void CyCity::changeCulture(int /*PlayerTypes*/ eIndex, int iChange, bool bPlots)
but the def that exposes it to Python is:
Code:
.def("changeCulture", &CyCity::changeCulture, "void (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).

I have just fixed this in SVN rev 3196 - let me know if you can use the (correct) 3 arguments now please.

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, False)

This produces no error message and (apparently) the correct culture adjustment:
Code:
city.changeCulture(unitStr, False)

Do you want my module files?
 
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?

No it's ok - I'll modify some test Python here to see what's going on for now.

Edit - although 'player' is not the rigth value to use in the first arg anyway - should be player.getID() - could you just try that for me before I look into i more (I'm trying to fix some other issues currently)
 
I think thjis is a bug in the (exposure of the) method being exposed to Python. The code has:
Code:
void CyCity::changeCulture(int /*PlayerTypes*/ eIndex, int iChange, bool bPlots)
but the def that exposes it to Python is:
Code:
.def("changeCulture", &CyCity::changeCulture, "void (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).

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.
 
Eh, that third part of the .def is just a help comment for Python as string, it has no meaning for the actual call.

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.
 
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)
 
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.
 
Its fine now I think.

OK. Thank you very much for your help. I'll post The Alamo on my Wonders thread once v25 is released. (I'm trying to at least get the artwork together for some ideas that don't have the code in place yet, so I may be able to post another Wonder or two once the new version is out.)
 
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())
?
 
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
 
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

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###
 
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###

No idea. What's not working about it?
 
Back
Top Bottom