Is there a way to require a specific resource within a city's potential boundaries?

JacenSaracen

Chieftain
Joined
Mar 26, 2011
Messages
36
In other words, is there a way to create a limitation that says, "You can only build a city if resource 'X' is within the new city's boundaries"?

Alternatively, "You can only build a city ON TOP OF resource 'X'"?
 
In other words, is there a way to create a limitation that says, "You can only build a city if resource 'X' is within the new city's boundaries"?

Alternatively, "You can only build a city ON TOP OF resource 'X'"?

You need to program for it in either Python (slow) or the dll.
 
Not long ago somebody had a crashing bug I looked at. It turned out that it could read from plots outside the map and I fixed that. That's interesting here because the function was looping all plots in range of a city to see if bonus X was available. In other words somebody already coded more or less what you ask for. It was done in the DLL.

The question now is which mod was it? It was some SciFi one :think:
 
Hehe it was with my incomplete mars mod:)

The mod comp ng is reffering too, is vicinity mod by shqype, which allows limit of units and buildings construction depending if a bonus is withinn the range of the working tiles of the city.
Whay you ask is unfamiliar to me, but perhaps can br achived.
Not long ago i asked a feature that spawns a bonus upon it.
So maybe that cab be used that, you can remove from all the terrain, along with all the features, all but that bonus spawn feature. And with this your goal can be achived.
 
The reason I ask is because I think it would be fun to create a version of Civ 4, where a resource that we shall call "CityPlot" is scattered randomly all over your map, say 5 per AI or player (or however much), and other than your first square at the very beginning, these are the ONLY places you can build cities. It would stop the AI from spamming cities, and it would pose an interesting challenge searching the map for places to build cities.
 
You can say that a city can't be built on a terrain feature using the bNoCity tag and bFound tag on the terrain. Can't see one for a resource.
 
You can say that a city can't be built on a terrain feature using the bNoCity tag and bFound tag on the terrain. Can't see one for a resource.

I considered this.... but you can't get true randomization of the terrain locations, can you? Are they not governed by the MapScript? Not to mention, I would want the terrain itself to have no function whatsoever, other than be a location where a city can be built. Don't terrains all have consequential functions (+1 happy, +2 food, etc...)?
 
I considered this.... but you can't get true randomization of the terrain locations, can you? Are they not governed by the MapScript? Not to mention, I would want the terrain itself to have no function whatsoever, other than be a location where a city can be built. Don't terrains all have consequential functions (+1 happy, +2 food, etc...)?

I would create a new Feature on a specific Terrain and disable the founding of cities on all other Features/Terrains.

You can then play with the tags iAppearance, iDisappearance and iGrowth if you want to spice it up.

Note: any terrain or feature can be neutral on the Yield changes.
 
Once upon a time I had this concept for FTTW in python (Only on founding square not city radius.) coded in python. Unfortunately it since got moved to the .dll.. I don't know if I still have an old enough version of the mod on my system, and it is on a computer that I don't have access to for at least a month..

The old thread also got lost I think when the site got ported to a new host.. I will have a dig in some of my old places see if I can find it's mention.
 
Link to my old work thread for this feature

Code:
def cannotFoundCity(self,argsList):
		iPlayer, iPlotX, iPlotY = argsList
		pPlot = CyMap().plot(iPlotX, iPlotY)
		for i in range(pPlot.getNumUnits()):
			pUnit = pPlot.getUnit(i)
			if pUnit.getUnitType() == gc.getInfoTypeForString('UNIT_SETTLER'):
				return False
			elif pUnit.getUnitType() == gc.getInfoTypeForString('UNIT_EXCAVATOR'):
				if pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_WHATEVER')  	
					return False
				return True
		return False

THis should be the python code you need for making a city founding feature. Unfortunately it was 7 years ago that I started that thread... damn that makes me depressed...
 
Top Bottom