Platyping's Python

1) Buffed Cyrus from 25% GG Rate to 50% GG Rate. (@Cybah, any % works because the system does award same GG points as Exp earned. Even 10% will work if a unit gain 10 exp in a tough battle)

2) Olympics permanent bonus changed from 1 trade route to 1 base commerce. Thus, can stack forever and won't interfere with any other things.

3) Fixed typo error in Olympics code that prevents Olympics from ending.
Spoiler :

Should be:
Code:
if iGameTurn % 25 ==5:

rather than:
Code:
if iGameTurn % 5 ==5:

4) Fixed logic error in Treaty of Versailles
Spoiler :

AI was building it when num of military units > 2 * Rival's
In other words, AI was building it when it has more units, a winning war.
Changed to 2 * num of military units < Rival's
Thus, AI will build it when it has less units, a losing war

5) Fixed Taipei 101 python Typo Error:
Spoiler :

Because it was a cut and paste wonder from Lotus,
I actually forgot to change the variable "BUILDING_LOTUS" to "BUILDING_TAIPEI_101" under def onBuildingBuilt

6) Widens Apadana Palace check from just checking Capital to nation wide, in case the capital was captured, and apadana ends up in a normal city of the opponent

7) Fixed a typo in Text File of Swords of Qadisiyah
Spoiler :

Changed from "Chance of Interception Nukes" to "Chance of Intercepting Nukes"

And now a National Wonder:

Cloning Factory
Spoiler :

Civ4ScreenShot0008-2.jpg


Clones a unit, literally.
Lucky => Great person, high experience unit
Unlucky => May be just a spy or worker lol
Worse => Cloning Failed

Note:
If a land unit in a transport is cloned, if the transport has space, or there are other transports, it will spawn on the spot. Else, it will spawn on nearby land plot


White House
Spoiler :

WhiteHouse.jpg


Losing War is defined as a war where number of military units of rival is twice as many as yours.
This 5% chance peace is per rival:
If you are warring with 5 civs, but only Babylon has twice more troops than you:
5% chance to peace with Babylon
0% chance to peace with others

+1 Relationship to Babylon and vice versa when peace is enforced.

Artwork by Rabbit, White
 
Remade Enhanced Original Traits:

1) Fixed alot of python exceptions since that was my first attempt:blush:
2) Used more efficient codes after gaining some experience making wonders:king:
3) Replace 1 trade route bonus of Financial Trait with 10% commerce. (1 Less Dummy Tech, less interference with future buildings giving Trade route bonus as well)
4) Uploaded to Database
5) Removed -50% hurry anger bonus for Charismatic Traits

Thank you for supporting

Coming Soon: CN Tower
 
For the White House, you should use getPower() instead of getNumMilitaryUnits().
 
Thanks for appreciating.

@Cybah Good suggestion using power score. Although it may be more accurate, because I still not too sure of the mechanics behind power score, so temporarily just using num of military units as a gauge.

@dacubz145 Nope, I will not make normal python buildings. Each line of python code requires processing time, no matter how negligible. In a huge map, there will be more than 100 cities, which means potentially 100 of that particular building. Even if the python code for that is just 1 line, that is more taxing on performance compared to a world wonder with 5 similar lines.

CN Tower
Spoiler :

Civ4ScreenShot0008.jpg


Actually, the most suitable wonder for this benefit is the Great Lighthouse. Because the main benefit is the ability to see submarines from far, I thought of setting it as a coastal wonder, which is however, not accurate for CN Tower. Oh well, at least you enjoy vision even if built inland.

I did not include ability to see stealth destroyer, since stealth is far more high tech compared to mass media

Another wonderful artwork by Rabbit, White


Cure for Cancer
Spoiler :

Civ4ScreenShot0002-9.jpg


Saw this benefit it ROM/AND mod, which I think is pretty suitable for CFC. However, it was achieved via extra XML tags in project XML, so I decided to do a python version for us without the extra tags.
 
Everything you build or research with iPower > 0 will increase getPower(). That's the same the BUG scoreboard uses for power ratio calculations. Should be no problem.
 
Hmm I see, any suggestion how much higher will you consider it as losing war?
25% higher? 50%?

Bolshoi
Spoiler :

Civ4ScreenShot0009.jpg


Extra culture are even shown in the tooltips


Edit:
Updated codes for following wonders for better accuracy due to getNumCities code:
Cure for Cancer, Dissolution of Monastries, Knossos, Olympics, Pha That Luang, WTC
 
Hm I would do: 5% Odds for -33% or less Power or 10% Odds for -50% or less Power.
 
1) Use powerscore to define losing war rather than nummilitary units for Treaty of Versailles and White House.
White House Changes:
Rival > 125% of Player => 5%
Rival > 150% of Player => 10%

2) Replace Cloning Factory with Human Genome Project. That "Cloning Factory" name just doesn't sound "wonderous" so got rid of it.

Human Genome Project
Spoiler :

Civ4ScreenShot0009-2.jpg



Area 51
Spoiler :

Civ4ScreenShot0004-4.jpg


Meant to be porcelain tower, but the more I read, porcelain tower is definitely meant to be just a buddhist pagoda, a religious wonder. So this benefit doesn't suit it at all. Can't find any other espionage looking wonder so finally decide to use Area 51...

If it is captured, full amount of player's EP is transferred over to the conquerer, so build at your own risk. Liberation doesn't trigger this.


Porcelain Tower
Spoiler :

Civ4ScreenShot0012-1.jpg


The old oracle. Don't ask me why it obsoletes with Computers. It's a trend

Artwork by Hrochland
 
yeah lol, but only EP against the conquerer is transferred, EP against others AI remain. You wanna build a secret base, you have to be prepared to protect the secrets:devil:

Oh well, even if the rival conquered it, EP is transferred over, but if you conquer it back, you snatch your EP plus his EP back, not a bad deal lol
 
for the theory of revolution, id say you should put something with great scientists versus great profets, since i dont think 20% effects that much, sonce great people arent that common, maybe something like for every great prophet you have they are replaced by two great scientists, or something similar
 
1) Removed redundant barbarian check for various wonders since MAX_CIV_PLAYERS was used anyway.
SETI, Lotus, Olympics, Treaty of Versailles, Zizkov

2) SETI converted to Project, shouldn't be a building in the first place.
No msg displayed when "nothing happens" for SETI
Fixed Great Wall logic error for "Assault". It was checking owner rather than rival

Theory of Evolution
Spoiler :

Evolution.jpg


Just a simple one. Actually the thing I wanna do is give a 3rd trait, but doesn't seem possible with python, so oh well...
 
1) Knossos Labyrinth changed to generate Great Engineer instead.

Not sure what you mean, if there are cities already present in turn 1 similar to advanced start, you can just randomly place the wonders in any cities similar to how Olympics is placed randomly

Neuschwanstein
Spoiler :

Neuschwanstein.jpg


Attackers won't die from it.
Damage is dealt after the combat, so combat odds not affected
Somehow, attackers that withdraw from combat aren't affected by def onCombatResults.
Thus, they aren't affected either.
 
Not sure what you mean, if there are cities already present in turn 1 similar to advanced start, you can just randomly place the wonders in any cities similar to how Olympics is placed randomly

Yess thats what I want, but i am really bad at python (I am trying though, since im taking a class on Java in school, and it seems somewhat similar although comands are alot different same idea), so could you give me like a quick lesson what to place where in the python code, and would i copy it every time for every building just replacing the building info?
 
Spoiler :
Code:
## Olympics Start ##
			if iGameTurn % 25 ==0:
				[COLOR="blue"]OlyPlayer = []
				for iPlayer in range(gc.getMAX_CIV_PLAYERS()):
					pPlayer = gc.getPlayer(iPlayer)
					if pPlayer.isAlive()==true:
						OlyPlayer.append(pPlayer)

				playerchance = CyGame().getSorenRandNum(len(OlyPlayer), "which player")
				pPlayer = OlyPlayer[playerchance][/COLOR]
				[COLOR="Red"]citychance = CyGame().getSorenRandNum(pPlayer.getNumCities(), "which city")
				i = 0
				(loopCity, iter) = pPlayer.firstCity(false)
				while(loopCity):
					if i == citychance:	
						[COLOR="Lime"]b_Olympics = gc.getInfoTypeForString("BUILDING_OLYMPICS")[/COLOR]
						[COLOR="Yellow"]loopCity.setNumRealBuilding(b_Olympics, 1)[/COLOR]
						loopCity.changeBaseYieldRate(2,1)
						CyInterface().addImmediateMessage( CyTranslator().getText("TXT_OLYMPICS_START",(loopCity.getName(),gc.getPlayer(loopCity.getOwner()).getCivilizationDescriptionKey(),)), None)
					i += 1
					(loopCity, iter) = pPlayer.nextCity(iter, false)[/COLOR]
## Olympics End ##


The statements in Blue select the random player.
The statements in Red select the random city of that player.
The statement in Green defines the building.
The statement in Yellow adds the building to the selected city.

However, this is only meant for adding 1 building to 1 random city.
If you want to add many buildings to many random cities, I suggest you use a for loop at the begining to go through the whole range of buildings, using
Code:
for i in range(gc.getNumBuildingInfos()):
	AncientWonder = gc.getBuildingInfo(i)
	if AncientWonder.getFreeStartEra() < 6: ## 6 stands for Future Era for default BTS
blah blah blah blah blah
then you won't need to define the building

I used something similar with Porcelain, so I dont have to do it 7 times for each temple. Can do the same for dissolution of monastries but... lazy to change

I think The_J used a different method to select random city for his circus, up to you which you prefer
 
By the way, I used a tedious method to choose random player because Olympics occurs throughout the game. Some players may be dead by then, and I don't want it to choose a dead player.

For your case, since it is at game start, you can just
Code:
randomplayer = CyGame().getSorenRandNum(gc.getMAX_CIV_PLAYERS(), "which player")
pPlayer = gc.getPlayer(randomplayer)

Similarly, I don't want to choose a dead city either. For your case, simplified version:
Code:
citychance = CyGame().getSorenRandNum(pPlayer.getNumCities(), "which city")
pCity = pPlayer.getCity(citychance)
 
Hey id like to see a reworked human genome project, i think the one you have now, the effects should go to a project more about cloning, the human genome project which i am learning about in school currently, (atleast for modern timesnot futuristic) isnt focussedon cloning people, but most of it is foccusses on noticing defects in new born babies and fixing them quicker, so i was thinking something like +1 health when the population goes up
 
Back
Top Bottom