Python: Oasis on the Pool of Tears

dnewhous

Chieftain
Joined
Oct 27, 2006
Messages
63
I want to have the Pool of Tears act as a fresh water source for adjacent tiles, and someone suggested that I use python to give the Pool of Tears the effects of an oasis. But after looking at the issue a little bit, my inference is that unless there is an appropriate function for the Pool of Tears in the API, there is no way to do this without recompiling the game. There isn't any such function being used in the game, and I really doubt a function would be in the API unless it were going to be used. But I wanted to come here and verify my tentative conclusion.
 
1. Open up CvEventManager.py
2. Scroll down to the function def onImprovementBuilt(self, argsList):
3. Add these 2 lines of code:
Code:
		if iImprovement == gc.getInfoTypeForString('IMPROVEMENT_POOL_OF_TEARS'):
			pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_OASIS'),-1)


If hell terrain spreads to the tile the feature will probably be destroyed, but otherwise you're fine. I was about to suggest editing the doHell function in CustomFunctions.py, but then I remembered that that python and the SDK handled terrain changes tend not to line up properly and you'd have to make Oases valid on hell terrains for it to work. You could do that and then made doHell change the feature to something else in hell if you like though.

If you don't want the Pool to have the extra yields of an Oasis, you can give the improvement the opposite yield changes as the feature.
 
The effect is to make the tops of a couple of palm trees stick out of the Pool of Tears. Nothing more.

Thanks for the help, even though it didn't work.
 
Back
Top Bottom