Tsentom1 Python Wonders

Longevity:

Longevity.jpg


This one is rather simple and it's been sitting on my computer for a while. My memory is failing me at the moment, but I'm pretty sure this was the Longevity Wonder bonus from Civ III, but you can use it for The Cure for Cancer or whatever. It probably works better for mods with an extended future but it's always helpful for late-game slavery. Anyway, I made this for someone's mod a while back so I'm just cleaning house and releasing it here as well.

Bonus is pretty self explanatory. You gain two population instead of one when your cities grow. I also added a global health bonus. It has a 3D wonder movie.
 
Nice one :). It's good to see old CivIII wonders converted to CivIV..

I apologize if this is too much to ask for, but could you please upload a version of Longevity as a World Project instead of a World Wonder? It would make more sense, imo :).
 
:thumbsup:

Any Peace Of Versailles news? :wavey:

I think I've figured it out code wise, I just have to find some time to code it now.

There is a conflict with the barbarian civ, CIVILZATION_BARBARIAN, and minor nations that the game code always checks for which could cause problems, so I also need to fix this.
 
Nice one :). It's good to see old CivIII wonders converted to CivIV..

I apologize if this is too much to ask for, but could you please upload a version of Longevity as a World Project instead of a World Wonder? It would make more sense, imo :).

The only thing preventing me is that, although I know the game must keep track of who built what project (as you can see this info in the info screen) I'm not actually sure how to check this with python. It must be a relatively simple one or two lines of code, I just need to search through the SDK and find it (and then hope it's exposed to the python).
 
:)


I would use it, if i hadn't done something like this for an other reason in my mod.

Yeah, I've actually had this on my computer for a while and in terms of python code I think it's barely two lines. So nothing really special here, just saw it on my desktop and wondering why I never posted it:confused:. I actually think I have a few modcomps just lying around like that. I'm so unorganized:crazyeye:
 
Hi Tsentom, I have some ideas to new wonders,

Legendary/Lost City of Eldorado (jungle tiles can give more gold on city plot, no unhealthy, etc)

Venice's Carnival (more trade output, less unhappiness, spy bonuses?)

Pablo Picasso Workshop (can give an great artist, increase city culture bonuses?)

Rio de Janeiro's Carnival (same logic used on Venice, but uses more modern technologies, like mass media, etc)

Trojan Horse (war bonuses, some units, free promotions to units?)

Nazca Animal Figures (natural resources bonuses, extra food?)

Count Dracula's Castle (I really don't know)

Spanish Toradas (the bloody sport with the red cape, poor bulls :lol:)

Mercator's office/workshop (something linked to maps, movements)

The Iliad (epic poem)

Porcelain Tower of Nanjing

Ely Cathedral

Itaipu Dam

Throne Hall of Persepolis
 
I tried to load the Spanish Inquisition Project into my mod, it doesn't seem to require theocracy to build. Anyone confirm that this is a requirement in their games to build this?

I used WB to add the techs and all and never changed civics but could still build it.

Just me?

It does require Theocracy, if it's not working as such in your mod I suspect an error in or forgetting to also merge all the parts of the GameUtil python file.
 
Could also be, that he didn't change the PythonCallbackDefines.xml, which i also forget every time :blush:.

True, though there's no callback for Create (Projects) or Maintain (Processes) like there is for Train (Units) and Construct (Buildings). I guess projects just aren't used enough to significantly alter performance and require one.
 
Should have looked into the files :blush:, i'm sorry.

Edit:
Interesting, didn't know that.

Haha, no, I wasn't trying to make a point. I had to double check myself and my first reaction was the python callback as well. I knew the processes didn't use one for sure but was only about 50% sure the projects didn't either.

The callbacks help stop the game from checking the python for the most used functions, which is why some of them turned on can really slow down the game. (I avoid the functions that slow down the game for the most part with my modcomps as they're probably more trouble than they are worth).
 
Hey tsentom, I have another question... I'm interested in adding your Sphinx wonder. However, I wonder whether it would be possible to prevent leaders with the Industrious trait from building it? Otherwise I fear it might be overpowered an Ind player gets his hands on it. If there's a simple code to do that, I'd be grateful. If not, don't bother, it's not that big of a deal :p.
 
Give it massive unhappiness with "trait happy" tag.

That's pretty funny. Can't you see the villagers?

"I love building and looking at wonders of the world. Except for this f&$#%*@ sphinx! That's one ugly lion-man-thing! #@$#!"

Realistically, you don't deny a Philosophical leader the ability to build the Parthenon? The key is finding a good balance with the Sphinx so you don't have to outlaw it completely.
 
Hey tsentom, I have another question... I'm interested in adding your Sphinx wonder. However, I wonder whether it would be possible to prevent leaders with the Industrious trait from building it? Otherwise I fear it might be overpowered an Ind player gets his hands on it. If there's a simple code to do that, I'd be grateful. If not, don't bother, it's not that big of a deal :p.

In the GameUtils python, for def cannotConstruct(self,argsList):

So take this:
Spoiler :
Code:
	def cannotConstruct(self,argsList):
		pCity = argsList[0]
		eBuilding = argsList[1]
		bContinue = argsList[2]
		bTestVisible = argsList[3]
		bIgnoreCost = argsList[4]
		return False
and add this:
Spoiler :
Code:
	def cannotConstruct(self,argsList):
		pCity = argsList[0]
		eBuilding = argsList[1]
		bContinue = argsList[2]
		bTestVisible = argsList[3]
		bIgnoreCost = argsList[4]

[B]##[/B]

[B]		pPlayer = gc.getPlayer(pCity.plot().getOwner())
		iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_INDUSTRIOUS')

		if (pPlayer.hasTrait(iTrait)):
			if eBuilding == gc.getInfoTypeForString("BUILDING_SPHINX"):
				return True[/B]

[B]##[/B]

		return False
Make sure to also activate the:
Spoiler :
Code:
	<Define>
		<DefineName>USE_CANNOT_CONSTRUCT_CALLBACK</DefineName>
		<iDefineIntVal>[B]1[/B]</iDefineIntVal>
	</Define>
Python Call Back if you aren't already using it.

You can also make the Sphinx more expensive to build for Ind players. So for example this is the current Sphinx code:
Spoiler :
Code:
	def getBuildingCostMod(self, argsList):
		iPlayer, iCityID, iBuilding = argsList
		pPlayer = gc.getPlayer(iPlayer)
		pCity = pPlayer.getCity(iCityID)
		
		iCostMod = -1 # Any value > 0 will be used

## Sphinx ##

		pBuildingInfo = gc.getBuildingInfo(iBuilding)
		iSphinx = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_SPHINX')
		aiExceptionList = [iSphinx]
		
		pPlayer1 = gc.getPlayer(pCity.plot().getOwner())

		bSphinx = gc.getInfoTypeForString("BUILDING_SPHINX")
		obsoleteTech = gc.getBuildingInfo(bSphinx).getObsoleteTech()
		if ( gc.getTeam(pPlayer1.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1 ):
			for iCity in range(pPlayer1.getNumCities()):
				ppCity = pPlayer1.getCity(iCity)
				if ppCity.getNumActiveBuilding(bSphinx) == true:
					if ((isWorldWonderClass(gc.getBuildingInfo(iBuilding).getBuildingClassType())) or (isNationalWonderClass(gc.getBuildingInfo(iBuilding).getBuildingClassType()))):

						if (not iBuilding in aiExceptionList):

							return 80	# 80% of normal cost

		return -1

## Sphinx ##
		
		return iCostMod
If you add the following (what's in Bold):
Spoiler :
Code:
	def getBuildingCostMod(self, argsList):
		iPlayer, iCityID, iBuilding = argsList
		pPlayer = gc.getPlayer(iPlayer)
		pCity = pPlayer.getCity(iCityID)
		
		iCostMod = -1 # Any value > 0 will be used

## Sphinx ##

		pBuildingInfo = gc.getBuildingInfo(iBuilding)
		iSphinx = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_SPHINX')
		aiExceptionList = [iSphinx]
		
		pPlayer1 = gc.getPlayer(pCity.plot().getOwner())

		bSphinx = gc.getInfoTypeForString("BUILDING_SPHINX")
		obsoleteTech = gc.getBuildingInfo(bSphinx).getObsoleteTech()
		if ( gc.getTeam(pPlayer1.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1 ):
			for iCity in range(pPlayer1.getNumCities()):
				ppCity = pPlayer1.getCity(iCity)
				if ppCity.getNumActiveBuilding(bSphinx) == true:
					if ((isWorldWonderClass(gc.getBuildingInfo(iBuilding).getBuildingClassType())) or (isNationalWonderClass(gc.getBuildingInfo(iBuilding).getBuildingClassType()))):

						if (not iBuilding in aiExceptionList):

							return 80	# 80% of normal cost


[B]		iTraitInd = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_INDUSTRIOUS')

		if (pPlayer.hasTrait(iTraitInd)):
			if (iBuilding in aiExceptionList):
				return 150	# 150% of normal cost [/B]


		return -1

## Sphinx ##
		
		return iCostMod
Ind leaders would for all intents and purposes have to pay full price to construct the Sphinx.
 
Back
Top Bottom