Herostratus
Grim Harbinger of Things to Come
- Joined
- Jul 24, 2009
- Messages
- 116
So my intent is that every time anyone founds a city using a Modern Settler, that city begins its existence at size 2. Seems simple enough, and I'm positive there are mods out there that do something similar.
Here is the CvEventManager code I borrowed from someplace to make it happen:
The problem I'm having is that this only works for the human player. I've tested it by giving the AI a Modern Settler unit, and cities that the AI founds with them start at size 1.
As you might be able to infer, I don't exACTly know what I'm doing when it comes to Python!
But my hope is it's a simple thing to resolve. Is anybody able to fix this for me?
Here is the CvEventManager code I borrowed from someplace to make it happen:
Code:
def onCityBuilt(self, argsList):
'City Built'
city = argsList[0]
pUnit = CyInterface().getHeadSelectedUnit()
if pUnit:
if pUnit.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_SETTLER"):
## Do Nothing
pass
elif pUnit.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_MODERN_SETTLER"):
city.setPopulation(2)
The problem I'm having is that this only works for the human player. I've tested it by giving the AI a Modern Settler unit, and cities that the AI founds with them start at size 1.
As you might be able to infer, I don't exACTly know what I'm doing when it comes to Python!
