Need Help: Small Change to Machu Pichu

PinkHammurabi

Warlord
Joined
Jul 11, 2008
Messages
249
Location
Sewell, NJ (but from Philly!)
Hey guys,

First of all, if this thread needs to be moved by the mods, thank you and sorry in advance; similarly, if this answer is easy to find somewhere, I apologize for that too. All the modding stuff is pretty overwhelming for me and I could easily have missed the answer somewhere in there.

What I want to mod is likely a very simple value somewhere, I just don't know where to find it. I want to change the requisite for Machu Pichu (and maybe even the Observatory) from a Mountain tile being 2 tiles away to 3 tiles away. Searching the Civ5 folders didn't get me anywhere, as all I found was the code saying NearbyMountain=True, which isn't quite what I want to change.

So, if someone can point me in the direction I'd much appreciate it. I have a few other building changes in that document (Civ5 Buildings), so sending me a file with that change wouldn't be as useful as a quick How To for this favor.

Since we're at it, does anyone know how the game would/may react to changing the aforementioned line to False? In case what I want is too complicated, for instance.

Thanks in advance, you guys. This community has always been wonderful and helpful. This and you guys are all much appreciated.
 
There's no way within XML to change the Machu Pichu NearbyMountainRequired requirement from within 2 tiles of a Mountain (ie, 1 intervening tile is allowed between city and Mountain) to within 3 tiles of a mountain (ie, 2 intervening tiles allowed between city and Mountain).

Simply changing NearbyMountainRequired to "false" in an update to Machu Pichu would result in there being no Mountain requirement at all.

Observatory has "<Mountain>true</Mountain>" which requires that the city be built adjacent to a mountain.
 
Hey P-H, what you are looking for is in:

bool CvCity::isValidBuildingLocation

Spoiler :
Code:
// Requires nearby Mountain (within 2 tiles)
	if(pkBuildingInfo->IsNearbyMountainRequired())
	{
		bool bFoundMountain = false;

		const int iMountainRange = 2;
		CvPlot* pLoopPlot;

		for(int iDX = -iMountainRange; iDX <= iMountainRange; iDX++)
		{
			for(int iDY = -iMountainRange; iDY <= iMountainRange; iDY++)
			{
				pLoopPlot = plotXYWithRangeCheck(getX(), getY(), iDX, iDY, iMountainRange);
				if(pLoopPlot)
				{
					if(pLoopPlot->isMountain() && !pLoopPlot->IsNaturalWonder() && pLoopPlot->getOwner() == getOwner())
					{
						bFoundMountain = true;
						break;
					}
				}
			}

			if(bFoundMountain == true)
				break;
		}

		if(!bFoundMountain)
			return false;
	}

Unfortunately, the "2" is a hard-coded constant, so you'd have to modify that and re-compile (or convert it into an XML variable).
 
Without making a new DLL, you'd have to remove the mountain requirement entirely from the XML and handle it completely with LUA. You'd need to use CityCanConstruct and only return true if the city is the distance you want from a mountain tile.
 
Top Bottom