Tech By Conquest

I currently still have the problem of the tech notice showing up when AIs conquer each others cities, so I'm not sure if I added used the new code correctly. Can anyone take a look for me? Thanks.

Try this:

Code:
def onCityAcquired(self, argsList):
	'City Acquired'
	iPreviousOwner,iNewOwner,pCity,bConquest,bTrade = argsList
# Tech By Conquest Mod
	# The Loser
	pPlayer1 = gc.getPlayer(iPreviousOwner)
	pTeam1 = gc.getTeam(pPlayer1.getTeam())
	# The Winner
	pPlayer2 = gc.getPlayer(iNewOwner)
	pTeam2 = gc.getTeam(pPlayer2.getTeam())
	FoundTransferTech = False
		
	if bConquest:
		if not pPlayer1.isNone() and not pPlayer1.isBarbarian():
		
			for iTech in range(gc.getNumTechInfos()):
				# Does Player1 have a Tech that Player2 does not have?
				if pTeam1.isHasTech(iTech):
					if not pTeam2.isHasTech(iTech):
						iTechToTransfer = iTech
						FoundTransferTech = True
						break
							
			if FoundTransferTech:
				TechDescription = PyInfo.TechnologyInfo(iTech).getDescription()
				#CyInterface().addImmediateMessage("Your scientists have discovered the knowledge of " + str(TechDescription), "")
				TechByConquestMessage = "You received the knowledge of " + str(TechDescription) + " from scientists of the city of " + str(pCity.getName())
				#CyInterface().addImmediateMessage(str(TechByConquestMessage), "")
				if gc.getPlayer(CyGame().getActivePlayer()).isHuman():
					CyInterface().addMessage(CyGame().getActivePlayer(),True,25,str(TechByConquestMessage),'AS2D_DISCOVERBONUS',1,'Art/Interface/Buttons/TerrainFeatures/Forest.dds',ColorTypes(8),0,0,False,False)
					
					
				pTeam2.setHasTech(iTech,True,iNewOwner,False,False)
					
				# Show tech splash 
				if (iNewOwner > -1 and not CyInterface().noTechSplash()):
					if (gc.getGame().isFinalInitialized() and not gc.getGame().GetWorldBuilderMode()):
						if ((not gc.getGame().isNetworkMultiPlayer()) and (iNewOwner == gc.getGame().getActivePlayer())):
							popupInfo = CyPopupInfo()
							popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
							popupInfo.setData1(iTech)
							popupInfo.setText(u"showTechSplash")
							popupInfo.addPopup(iNewOwner)
				
			elif gc.getPlayer(CyGame().getActivePlayer()).isHuman():
				CyInterface().addImmediateMessage("The vanquished have no useful scientific knowledge.", "")
# End Tech By Conquest Mod

	CvUtil.pyPrint('City Acquired Event: %s' %(pCity.getName()))
 
How would you change it so this only occurs after a city is out of revolting?
 
I would really like to add this to a working mod already, 1st of all what is the difference in WOC and standard? could i use put one of them in a modular loading in a modules folder, to an already added mod? if not how would i go about merging this with another mod that already has another CvEventManager.py that has been modded
 
I would really like to add this to a working mod already, 1st of all what is the difference in WOC and standard? could i use put one of them in a modular loading in a modules folder, to an already added mod? if not how would i go about merging this with another mod that already has another CvEventManager.py that has been modded

You could try downloading some of the more popular big mods like Rise of Mankind, RevDCM or Grand Inquisitions. All 3 are excellent mods and consist of many brilliant ideas from some of the best programmers Civ Fanatics has to offer. All the hard work of mod making has been done for you. Grand Inquisitions just happens to be my mod, which is currently being updating with just a few extra improvements. It won't be long until another release. My suggestion to you is to download all 3 mods and then have fun!
 
Top Bottom