SIMPA
Mar 07, 2009, 03:25 AM
Hello all
I have 2 questions:
1 Does someone knows is it possible to change population like hanging gardens do but not on global level,just to change population in one city..for example you build some building and that give you 2 population only in that city....:rolleyes:
2 Where can I change how many national wonders city can build....
Thx guys and girls....:)
Shiggs713
Mar 07, 2009, 11:35 AM
1) unfortunately there is no xml tag for iPopulationChange. You could add to the iHealth or iFreeSpecalist to give a health bonus or free specialist instead of the iGlobalPopulationChange (which is what hanging gardens does).
otherwise you would have to add to the SDK and the schema before you could actually add the tag: iPopulationChange
2) in the globaldefines.xml, in the define that says, "MAX_NATIONAL_WONDERS_PER_CITY"
General Tso
Mar 07, 2009, 01:01 PM
If you're familiar with Python, you could do it manually in onBuildingBuilt (it's located in CvEventManager.py).
SIMPA
Mar 08, 2009, 07:08 AM
Hey thx guys...
Just one thing..that someone allready code the python that building can give population in city where is build..I look in thomas war but I didnt find..
Please if someone know ....:(
SIMPA
Mar 08, 2009, 04:01 PM
Ok tsentom1 help me about this...it is very simple...
Thx you all people for help...
thx tsentom1..
Flying Pig
Mar 09, 2009, 01:32 PM
Can you publish the method you used?
tsentom1
Mar 09, 2009, 02:21 PM
Can you publish the method you used?
def onBuildingBuilt(self, argsList):
'Building Completed'
pCity, iBuildingType = argsList
game = CyGame()
###
if ( iBuildingType == gc.getInfoTypeForString("BUILDING_XXXXXX") ):
pCity.changePopulation(1)
###
if (not self.__LOG_BUILDING):
return
CvUtil.pyPrint('%s was finished by Player %d Civilization %s'
%(PyInfo.BuildingInfo(iBuildingType).getDescriptio n(), pCity.getOwner(), gc.getPlayer(pCity.getOwner()).getCivilizationDesc ription(0)))
You can add an XML help txt to the BuildingInfos XML file if you want it to read "+1 Population" etc.
Flying Pig
Mar 09, 2009, 04:19 PM
Thanks. I take it this goes in the eventlog thing like all your other wonde code?
mechaerik
Mar 09, 2009, 05:29 PM
tsentom, you are a python magician :bowdown::bowdown::bowdown::bowdown::worship::wors hip::worship::worship:.