Making all cities hold one building to create a 1-tier radius

Arctic Circle

Prince
Joined
Apr 24, 2008
Messages
473
Hello. I was wondering if someone could help me with how to make it so that all the cities I build or conquer will be given an specific building?

The reason for this is that I want to have set a 1-Tier radius on all the cities belonging to the Jotnar civilization.

/Thanks
 
Hello. I was wondering if someone could help me with how to make it so that all the cities I build or conquer will be given an specific building?

The reason for this is that I want to have set a 1-Tier radius on all the cities belonging to the Jotnar civilization.

/Thanks

i'm not a python expert, but it should work similar like that:

Code:
	def onCityAcquired(self, argsList):
		'City Acquired'
		iPreviousOwner,iNewOwner,pCity,bConquest,bTrade = argsList

		pNewOwner = gc.getPlayer(iNewOwner)
		if pNewOwner == gc.getInfoTypeForString("YOUR_CIV_NAME_HERE"):
			b_BUILDING_oneTIRE = gc.getInfoTypeForString("BUILDING_YOUR_BUILDING_NAME_HER")
			pCity.setNumRealBuilding(b_BUILDING_oneTIRE,1)

the same needs to be done at onCityBuilt

i hope this works and helps...
 
or you could make it so that the palace gives that free building to every city.
but i dont know what happens if you lose your capital? do you get a new palace in the new capital automatically or do you have to build it first?
if you get a new palace in the new capital automatically this would be the better solution.
(if that's not the case you could make it a special feature for your civilization that it will get a free palace in your new capital)
 
i'm not a python expert, but it should work similar like that:

Code:
	def onCityAcquired(self, argsList):
		'City Acquired'
		iPreviousOwner,iNewOwner,pCity,bConquest,bTrade = argsList

		pNewOwner = gc.getPlayer(iNewOwner)
		if pNewOwner == gc.getInfoTypeForString("YOUR_CIV_NAME_HERE"):
			b_BUILDING_oneTIRE = gc.getInfoTypeForString("BUILDING_YOUR_BUILDING_NAME_HER")
			pCity.setNumRealBuilding(b_BUILDING_oneTIRE,1)

the same needs to be done at onCityBuilt

i hope this works and helps...

To set a building into a city use this:
Code:
pCity.setHasRealBuilding(9,1)
#                #9 gives it an aqueduct in this mod; 1 adds the building (check XML)
or at least that's the vanilla civ4 command that works... getNumRealBuilding(INT) is BTS (to do the reverse of course).
9 is aqueduct in greekworld mod.
 
The Infernals only get the buildings upon building a city, not upon conquest.


I don't think that the game currently has the ability to limit a city to a 1 tile radius. Only 0 and 3 make any sense in the city radius tag.
 
i like the idea of a civ with city radius 1 if it is balanced correctly.
 
Couldn't you take the coding from Kuriotate settlements, since they can only use the first ring around a city?
 
Back
Top Bottom