j_mie6
Deity
hmmm thats odd can you post the for loop of mine that you were using?
for i in range(21):
pPlot = pCity.getCityIndexPlot(i)
Thanks for the complements.
No idea either, because I seldom use that city index for loop myself.
Only saw it being used by jamie for his natural wonder codes, so use it to replace my own for loop since it seems shorter.
But if it is causing problems, try using my original loop:
Code:iX = pCity.getX() iY = pCity.getY() for x in range(iX - 2, iX + 3): for y in range(iY - 2, iY + 3): if abs(x - iX) != 2 or abs(y - iY) != 2: pPlot = CyMap().plot(x,y) if pPlot.isWater() and pPlot.getBonusType(-1) == -1: randBonus = CyGame().getSorenRandNum(15, "Freebie") if randBonus < 3: pPlot.setBonusType(MarineResource[randBonus]) pPlot.setImprovementType(fboat) CyInterface().addMessage(iPlayer,true,15,CyTranslator().getText("TXT_TSUKIJI_BONUS",(gc.getBonusInfo(MarineResource[randBonus]).getDescription(),)),'',0, gc.getBonusInfo(MarineResource[randBonus]).getButton(),ColorTypes(11), x, y, true,true) ## Tsukiji Fish Market End ##
It may be clearer if you enable python exceptions to see exactly which line went wrong because the list index may be pointing to MarineResource rather than the for loop
This is under onBuildingBuilt, the rest of the codes shouldn't be causing problems.
pPlot.setBonusType(MarineResource[randBonus])
. Your code works fine. And the error makes a whole lot of sense if one thinks about it.pPlot.setBonusType(MarineResource[randBonus])


increased performance 

. Btw, if you hate the world thinks you are a villain - I've written code for a wonder which reduces the effect to 1 turn 
that could be a useful piece of code to adapt to a wonder in my next mod where the Apostolic palace is built turn 0
In the case of my mod it would really have to be a religious wonder to be able to appease the religious people complaining that I am a villain 
# Volkshalle Wonder Start
def anger_check(iPlayer):
pPlayer = gc.getPlayer(iPlayer)
iRefCityList = PyPlayer(iPlayer).getCityList()
b_Volkshalle = gc.getInfoTypeForString("BUILDING_VOLKSHALLE")
obsoleteTech = gc.getBuildingInfo(b_Volkshalle).getObsoleteTech()
if ( gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1 ):
for pyCity in iRefCityList:
pCity = pyCity.GetCy()
if pCity.getNumActiveBuilding(b_Volkshalle) == 1:
for pyCity in iRefCityList:
pCity = pyCity.GetCy()
anger = pCity.getDefyResolutionAngerTimer()
if (anger > 0):
pCity.changeDefyResolutionAngerTimer(-anger)
# Volkshalle Wonder End
. I applied it to the Volkshalle wonder - I figured it somehow appropriate the worshippers of a cruel and bloodthirsty dictator couldn't care less about what the world outside thinks...


