View Full Version : Question: How to make something only buildable on a hill?


MaxAstro
Feb 16, 2008, 10:48 AM
Is it possible to make a city only able to construct something if the city is built on a hill? I'm trying to add a new defensive structure for the Khazad that can only be built on a hill city, but I don't see if there is a way to do this...

Anyone know how?

MagisterCultuum
Feb 16, 2008, 11:05 AM
You could create a python block preventing it from being built otherwise. Of course, this could get confusing to other players as there would be no in game documentation of why the building cannot be built elsewhere (although yo could mention it in the civilopedia entry).

To do so, add something like this to the "def cannotConstruct(self, argsList):" function of the CvGameUtils.py file:

if eBuilding == gc.getInfoTypeForString('BUILDING_NEW_BUILDING'):
pPlot = pCity.plot()
if not pPlot.isHills():
return True

MaxAstro
Feb 16, 2008, 11:55 AM
Ah, that is exactly what I was looking for, thanks! As far as it being confusing, I'll just put a note in the Strategy for the building; that should show up on mouseover and explain everything to confused players.

EDIT: Unfortunately it seems strategy tips do not always show up when you want them to... but at least the info is in the pedia.