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

MaxAstro

Spiral Knight
Joined
Dec 18, 2007
Messages
645
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?
 
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:
Code:
		if eBuilding == gc.getInfoTypeForString('BUILDING_NEW_BUILDING'):
			pPlot = pCity.plot()
			if not pPlot.isHills():
				return True
 
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.
 
Back
Top Bottom