troyDoogle7
Jan 02, 2007, 02:02 PM
I would like to have a protectionist civilization, that is granted free city walls in a city, whenver they found a city. Is this possible?
I would also like to to have a higher initial city population when its founded. ie population of 3 instead of 1.
Is this possible?
ClassicThunder
Jan 02, 2007, 02:13 PM
I would like to have a protectionist civilization, that is granted free city walls in a city, whenver they found a city. Is this possible?
I would also like to to have a higher initial city population when its founded. ie population of 3 instead of 1.
Is this possible?
I would suggest adding in these lines of python code in the on city built event in CvEventManager.py.
pCity.setPopulation(3) #Sets population
pCity.setHasRealBuilding(gc.getInfoTypeForString(' Building_Name_Here, 1) #Adds building
troyDoogle7
Jan 02, 2007, 02:37 PM
Thanks classic, you are a legend..
If I want a wonder to grant the ability to set the population to 3 of any new founding cities how would I do this?
ClassicThunder
Jan 02, 2007, 03:11 PM
Set the population to 3 or add three to the population?
To set use
pCity.setPopulation(3) #Sets population
To add 3 use
pCity.changePopulation(3)
You can change the above number to anything including a negative to subtract population.
lshockley
Jan 02, 2007, 07:15 PM
I would also like to to have a higher initial city population when its founded. ie population of 3 instead of 1.
Hi Doogle,
I think you can also do this by editing Assets/XML/GlobalDefines.xml:
<Define>
<DefineName>INITIAL_CITY_POPULATION</DefineName>
<iDefineIntVal>1</iDefineIntVal>
</Define>
Just change the integer value to whatever you'd like.
Happy modding! -Laina
troyDoogle7
Jan 05, 2007, 12:26 PM
thanks for the help laina, however I am trying to contruct the planetary transit system (http://en.wikibooks.org/wiki/Civ:SMAC_Secret_Project_Index#Planetary_Transit_Sy stem) which grants the population boost to the civilization that owns the wonder, ie only to one civilization.
Lord Olleus
Jan 07, 2007, 08:53 AM
Add something like this to the 'onCityBuilt' event:
iNumCities = gc.getPlayer(iPlayer).getNumCities()
for i in range(iNumCities):
[tab]pLoopCity = gc.getPlayer(iPlayer).getCity(i)
[tab]if pLoopCity.isHasRealBuilding(gc.getInfoStringForTyp e("BUILDING_NAME"), true)
[tab][tab]pCity.setPopulation(3) #Sets population