Capital city

I'm pretty sure you'd need to do this through Python. Shouldn't be that hard though.
 
If you're willing to give python a shot, try this:

From CvGameUtils.py

Code:
	def cannotConstruct(self,argsList):
		pCity = argsList[0]
		eBuilding = argsList[1]
		bContinue = argsList[2]
		bTestVisible = argsList[3]
		bIgnoreCost = argsList[4]
		pPlayer = gc.getPlayer(pCity.getOwner())
		capital = pPlayer.getCapitalCity() 		
		if not pCity == capital:
			if eBuilding == gc.getInfoTypeForString('BUILDING_YOUR_BUILDING'):
				return true	
		return False

I also think you need to enable the cannotConstruct function in the PythonCallbacks XML file for this to work. Not 100% that code will function, but it's close, if it doesn't work let me know and I'll see if I can figure it out, but I think that code should work.
 
You don't need to use python - iyou can do it entirely in the XML, in CIV4BuildingInfos.xml.

Just make the building require the Capitol building. The Capitol building is, by definition, always in the capital city.
 
Oh, yeah, you're right, you can just make it require the palace... good call.
 
Top Bottom