I've been trying to make a trait that gives a free building to any city with 3 or more pop, which in itself is easy enough, however i can't seem to keep that seperate from another trait that gives a free building to any city with 8 or more pop
They both work seperately but when put together any player with either trait gets the bonuses of both, so how can i seperate them and is it possible to have a civ with both traits still get both bonuses?
p.s credit go's to servomod for the tolerant bit of code,
Code:
def checkCityForTrait(self, argsList):
city = argsList
if (self.TolTrait < 0):
for iTrait in range(gc.getNumTraitInfos()):
if (gc.getTraitInfo(iTrait).getTextKey() == 'TXT_KEY_TRAIT_TOLERANT'):
self.TolTrait = iTrait
if (gc.getPlayer(city.getOwner()).hasTrait(self.TolTrait)):
if (city.getPopulation() >7):
if (self.TolBuilding < 0):
for iBuild in range(gc.getNumBuildingInfos()):
if (gc.getBuildingInfo(iBuild).getType() == 'BUILDING_TOLERANT'):
self.TolBuilding = iBuild
city.setHasRealBuilding(self.TolBuilding,1)
#SevoMess("Added %s to %s" %(self.TolBuilding, city.getName()))
if (self.civTrait < 0):
for iTrait in range(gc.getNumTraitInfos()):
if (gc.getTraitInfo(iTrait).getTextKey() == 'TXT_KEY_TRAIT_CIVIL'):
self.civTrait = iTrait
if (gc.getPlayer(city.getOwner()).hasTrait(self.civTrait)):
if (city.getPopulation() >2):
if (self.civBuilding < 0):
for iBuild in range(gc.getNumBuildingInfos()):
if (gc.getBuildingInfo(iBuild).getType() == 'BUILDING_CIVIL'):
self.civBuilding = iBuild
city.setHasRealBuilding(self.civBuilding,1)
They both work seperately but when put together any player with either trait gets the bonuses of both, so how can i seperate them and is it possible to have a civ with both traits still get both bonuses?
p.s credit go's to servomod for the tolerant bit of code,