can't get python working

smeagolheart

Monarch
Joined
Sep 4, 2007
Messages
924
Location
Phoenix, AZ
I'm trying to merge tsentom1's python trait seafaring into bug and it's not giving me any errors, but it's not giving people with the trait the tech.

The offending code is:
Code:
## Sea Trait Start ##
		for iPlayerLoop in range(gc.getMAX_CIV_PLAYERS()):

			pPlayer = gc.getPlayer(iPlayerLoop)

			if (pPlayer.isAlive()):

				iTraitSea = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_SEAFARING')	

				if (pPlayer.hasTrait(iTraitSea)):

					iTechSailing = CvUtil.findInfoTypeNum(gc.getTechInfo,gc.getNumTechInfos(),'TECH_SAILING')
					pTeam = gc.getTeam(pPlayer2.getTeam())
					pTeam.setHasTech(iTechSailing, true, iPlayer, false, false)

## Sea Trait End ##

Any ideas folks?
 
Why pPlayer2 on this line?

Code:
pTeam = gc.getTeam(pPlayer2.getTeam())

I believe you just need to remove the 2.
 
Are you including the full CvEventManager or everything from it in your Python module? Check out the tutorial in my sig for how to add events to BUG.
 
Top Bottom