Adding FFH2's Blight event to Civ4 BTS - how hard?

Zeiter

Prince
Joined
Nov 20, 2008
Messages
327
So, I would like to add the "Blight" event from FFH2 to regular BTS (well, technically, a personal mod of BTS). It would be cool to have an occasional "great plague" type of event.

First of all, where is the code for the "Blight" event located in the FFH2 files, aside from the usual event and event trigger xml files? I'm assuming that there is some python coding behind the blight event too, right?

Second, I know that I would have to change some things, such as producing a different trigger and removing the effects of buildings that aren't in regular BTS. How hard would that be?

Third, would it just be easier to make a new blight event that is slightly different and that doesn't deal with python? I think what I could do is make an event using only xml that gives a flat permanent global health penalty, and then create another event that is triggered by the original plague event with some delay that would add back an equal permanent health bonus.

Also, if there already exists an event pack for BTS that has an additional event like this, please let me know. I could just use that.

Thanks!
 
1) It's in CvRandomEventInterface.py, the doArmageddonBlight function.
2) Not very hard at all, if you get into the Event XML a bit (see this guide for example).
3) I guess that's more complicated than using the python code.

Keep in mind that the blight event from FfH is pretty devastating. It also only triggers once, when a specific armageddon counter state is reached. You'd better scale down it's effects if you want it to trigger randomly.

Below a probably bts-compatible version (untested!) of the blight python code, without the last three lines, that cause damage to units (don't know how to do this in bts; somebody else has to help if you want this, too).

Code:
def doArmageddonBlight(argsList):
	kTriggeredData = argsList[0]
	iPlayer = argsList[1]
	pPlayer = gc.getPlayer(iPlayer)
	py = PyPlayer(iPlayer)
	for pyCity in py.getCityList():
		pCity = pyCity.GetCy()
		i = CyGame().getSorenRandNum(15, "Blight")
		i += pCity.getPopulation()
		i += pCity.getFeatureBadHealth()
		i -= pCity.getFeatureGoodHealth()
		i -= pCity.totalGoodBuildingHealth()
		if i > 0:
			pCity.changeEspionageHealthCounter(i)
 
Back
Top Bottom