Platyping's Python

For my modern mod im going to add your cure for cancer wonder, but since it doesnt count the future, im changing cancer to polio. I want to give the builder a relationship bonus to every other country, representing them being happy they have found the cure, could work for your cure for cancer as well

So what would i add to the python code?
 
Direct cut and paste from Taipei:
Code:
#### Check for all players, alive and non-barbarian
			for iPlayer2 in range(gc.getMAX_CIV_PLAYERS()):
				pPlayer2 = gc.getPlayer(iPlayer2)
				if (pPlayer2.isAlive()==true) and (pPlayer2.isBarbarian()==false):
					pPlayer2.AI_changeAttitudeExtra(iTeam, 1)

Assuming iTeam refers to Team which built CFC
 
Pretty easy to disable building units, but what is the point, you end up as sitting duck waiting to be slaughtered

Especially if no one is pleased with you... Then you are at defensive pack with nobody and still cannot defend yourself

Or maybe disables war with the civ that builds it? I could really use it for my mod to represent Costa Rica, maybe required the UN to already be built?
I can understand if you dont want to release it and put it in your mod, but could you possibly do it as a seperate project if it is really easy to disable building units
 
Direct cut and paste from Taipei:
Code:
#### Check for all players, alive and non-barbarian
			for iPlayer2 in range(gc.getMAX_CIV_PLAYERS()):
				pPlayer2 = gc.getPlayer(iPlayer2)
				if (pPlayer2.isAlive()==true) and (pPlayer2.isBarbarian()==false):
					pPlayer2.AI_changeAttitudeExtra(iTeam, 1)

Assuming iTeam refers to Team which built CFC

Do i place it in the cveventmanager? and at the bottom of the specific code?
 
Change this part
Code:
	def onProjectBuilt(self, argsList):
		'Project Completed'
		pCity, iProjectType = argsList
		game = gc.getGame()

## Cure For Cancer ##
		if ( iProjectType == gc.getInfoTypeForString("PROJECT_CURE_FOR_CANCER") ):

		#### Extra for Owner
			pPlayer = gc.getPlayer(pCity.getOwner())
			pPlayer.changeExtraHappiness(1)
			(loopCity, iter) = pPlayer.firstCity(false)
			while(loopCity):
				loopCity.changeExtraHealth(1)
				(loopCity, iter) = pPlayer.nextCity(iter, false)

			iTeam = pPlayer.getTeam()
			for iPlayerX in range(gc.getMAX_CIV_PLAYERS()):
				pPlayerX = gc.getPlayer(iPlayerX)
				if pPlayerX.isAlive():
					(loopCity, iter) = pPlayerX.firstCity(false)
					while(loopCity):
						loopCity.changeExtraHealth(1)
						(loopCity, iter) = pPlayerX.nextCity(iter, false)
					pPlayerX.AI_changeAttitudeExtra(iTeam, 1)
## Cure For Cancer ##
 
Change this part
Code:
	def onProjectBuilt(self, argsList):
		'Project Completed'
		pCity, iProjectType = argsList
		game = gc.getGame()

## Cure For Cancer ##
		if ( iProjectType == gc.getInfoTypeForString("PROJECT_CURE_FOR_CANCER") ):

		#### Extra for Owner
			pPlayer = gc.getPlayer(pCity.getOwner())
			pPlayer.changeExtraHappiness(1)
			(loopCity, iter) = pPlayer.firstCity(false)
			while(loopCity):
				loopCity.changeExtraHealth(1)
				(loopCity, iter) = pPlayer.nextCity(iter, false)

			iTeam = pPlayer.getTeam()
			for iPlayerX in range(gc.getMAX_CIV_PLAYERS()):
				pPlayerX = gc.getPlayer(iPlayerX)
				if pPlayerX.isAlive():
					(loopCity, iter) = pPlayerX.firstCity(false)
					while(loopCity):
						loopCity.changeExtraHealth(1)
						(loopCity, iter) = pPlayerX.nextCity(iter, false)
					pPlayerX.AI_changeAttitudeExtra(iTeam, 1)
## Cure For Cancer ##

Worked like a charm thanks:D tomorrow I plan on transforming your art of war into a modern project: Blitzkrieg :D
 
Oh yeah, come to think of it. The 2 nuclear projects are still useful with UN ban.

UN ban only prevents you from building new ones.
It doesn't stop you from launching existing ones.
 
But doesnt this just duplicate the UN thing, that bans all nukes? if that is in place then the project is useless.

Not necessarily, because at the point of the nuke ban there could already be plenty of nukes around and you can still nuke someone.
 
Not necessarily, because at the point of the nuke ban there could already be plenty of nukes around and you can still nuke someone.

True, platyping already said that about two posts up ;)

But just from expirience, if you typically play long games (w.o the winner winning at 2050) then if the nukes were banned, theres usually not that many in the first place and people that like to build them run out of them pretty quick:crazyeye:

Something that bothers me though is why do you NEED to be in the UN, is there anyway to mod something to get out of it?
 
1) Ivy Mike:
Added a nuke immune check, so that extra damage does not affect those units.

2) Empire State Building:
Code Overhaul:
Spoiler :

A) Code changed from checking individual bonus type, to checking bonus class type.
Thus, all Rush, Modern and Wonder Bonus Class Types are excluded.
Obsolete Bonuses are still excluded.
Coal is added as an Excluded Bonus specifically because it belongs to General Class Type.
Thus, ESB will now be compatible with other mods with alot of extra bonuses, without the need to add to exclusion list one by one.

B) ESB now provides 3 new random Bonus resources when captured. Previously, the 3 old resources are removed, but no new ones added, making ESB a useless wonder if captured. Now it provides 3 new ones.

3) Advisor Tag XML changes:
Changed to more appropriate ones.
Eg, Helsinki changed from Religion Advisor to Culture Advisor.
Adam Smith, CN Tower, Cyrus Cylinder, Helsinki Cathedral, Porcelain Tower

4) Megapack:
Above changes made.
Added Ivy Mike, NPT and Louvre.

And now... presenting to you, the 50th masterpiece :goodjob:

Louvre
Spoiler :

Louvre.jpg


Since it is a museum, the more oldies you have, the better it is.
Obsolete ones still counted.
National ones not counted.

Artwork unsure made by who.

Note to Modders:
By right, I should do an additional check in def onBuildingBuilt, to check if there is a new Ancient/Classical Wonder built after Louvre is built, and update Louvre. But chances of that happening in Renaissance Era is negligible so I didn't bother.
 
whats that?

Promotions that would do the following (1 free given to a settler)
*Free specific building in the city it constructs
*The state religion founded in the city
*Population bonus in the city
*Culture bonus
*Protected (adds a military unit to the settler to protect it)

The religion one has already been done (not in promotion form though), but cant seem to get it to work in my mod
 
In short, similar to what colonists and pioneers do in ROM/AND mod?
Not hard to cut and paste, but I did not have the python files lol

Cut and paste is easy job.
But, setting them as promotions, AI will never learn them since they don't see any benefits
 
Simple test, just make a new promotion with totally no benefits.
Make it available to settler and you will know
 
1) Dump whole chunk of codes to def onUnitBuilt
2) Change from checking whether it is project SunTzu to unit XYZ built
3) Add an extra check on unit combat type whether it is Air, like what you did in slavery mod
4) Check all variables

J.S. Bach's Cathedral
Spoiler :

JSBach.jpg


Example:
Huge world => 4 Temples to make 1 Cathedral
With JS Bach => 3 Temples to make 1 Cathedral

However, Tooltip will still display 5/8 to build 2nd Cathedral
But once you build the 6th Temple, Cathedral will be available

Yes, I know Bach is a musician, got nothing to do with religion.
But don't ask me why cathedral is a religious building in Civ IV


I am finally done making all Civ 1 to V wonders :goodjob:
 
Back
Top Bottom