Razing capitals

rf900

Warlord
Joined
Jan 31, 2006
Messages
194
Just a merely information post as I know lot of people asked for this. I have been waiting for this option to be able to recreate a mod I did for Civ4, named Capitals&Outposts, that required forcing the player to raze cities.

With the released SDK I think we can now achieve this. Haven't tried yet but found this code that will probably allow it:

In file: CvPlayer.cpp
Under CanRaze function

Code:
	if(!bIgnoreCapitals && pCity->IsEverCapital() && bOriginalCapital)
	{
		return false;
	}
 
can't this be done in Lua? (just asking, I never tried to force a city in raze mode with the Lua fonction)
 
Just a merely information post as I know lot of people asked for this. I have been waiting for this option to be able to recreate a mod I did for Civ4, named Capitals&Outposts, that required forcing the player to raze cities.

With the released SDK I think we can now achieve this. Haven't tried yet but found this code that will probably allow it:

That's the easy part. The hard part is finding ALL the places in the code where it is assumed that a player always has a valid "original capital" city (even if that player no longer controls it)
 
can't this be done in Lua? (just asking, I never tried to force a city in raze mode with the Lua fonction)

No it can't. The Lua method merely calls CvPlayer:raze() and the first thing that does is check that the city can be razed, via the CvPlayer:canRaze() method, which will fail for capital cities
 
thanks for the precision, now I remember it would have required to completly rewrite the feature in Lua (remove one pop/turn, kill it at the end, override the UI, adress the issues that would have arised, etc...)
 
That's the easy part. The hard part is finding ALL the places in the code where it is assumed that a player always has a valid "original capital" city (even if that player no longer controls it)

Well, in my mod once the player lost the capital he was removed from the game. Probably the easiest way would be to assign a new capital to another city, like in Civ4, the domination VC will need to be revised also.
 
Back
Top Bottom