Platyping's Python

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 :



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:
 
You mean Bach? I can see it, you mean you cannot see it? Strange :crazyeye:
 
Great ideas a gain :goodjob:.

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

Tsentom did a wonder with parts of these effects.
 
would be good if you have some ideas what effects to give it lol.

Thinking of effects for a name is bigger headache than thinking of a name to for an effect
 
Here are a couple of ideas that you could use for it:
1)reduces war weariness
2)improves attitude with enemies
3)provides a free medic promotion in the city
4)allows for more military drafting
5)increases espionage against enemies.
 
1 and 3 are XML stuff
2 and 5 done, trying not to repeat similar effects
4 is the only one I been experimenting how to do :shake:
 
Disables Building of Military Units:
Code:
	def cannotTrain(self,argsList):
		pCity = argsList[0]
		eUnit = argsList[1]
		bContinue = argsList[2]
		bTestVisible = argsList[3]
		bIgnoreCost = argsList[4]
		bIgnoreUpgrades = argsList[5]
## Arc De Triomphe Start ##
		pPlayer = gc.getPlayer(pCity.getOwner())
		bc_Triomphe = gc.getInfoTypeForString("BUILDINGCLASS_ARC_DE_TRIOMPHE")
		if pPlayer.getBuildingClassCount(bc_Triomphe) == 1:
			if gc.getUnitInfo(eUnit).isMilitaryProduction() == true:
				return True
## Arc De Triomphe End ##
		return False

For dacubz145. Never test, let me know if doesn't work. Make sure you set python callback to 1

Edit: Changed from checking unit combat class to militaryproduction. Forgot missiles have no combat class
 
Simple and easy:

Pergamon Altar
Spoiler :



The idea is from the word Giant.
Well, giant... the more you kill, the faster your GG grow, while making your rivals smaller and smaller.

If the rival's GG point is 0, it will go negative. It does not drop to previous level.
So from 0/60 it will become -2/60 which means he will now need 62 GG points to get a GG.

Artwork taken from PIE mod


Wonder of Suprise:

Nazca Lines
Spoiler :



Since nobody knows the purpose of nazca lines, I obviously dunno what it should give.
Thus, it ends up as a wonder that gives benefits which nobody knows until it is built.
And even after it is built, nobody knows what it will end up after several era advances.
Ancient era = 1 benefit, future era = 7 benefits.

Thus, it may end up giving purely 14 happiness or maybe 8 food, 8 production, 6 health.
Totally random wonder each game.

Artwork taken from History Rewritten mod


JS Bach, Peragon Altar, Nazca Lines updated into Megapack

P.S.
Any module making tutorial lying around? Megapack now 4MB time to shrink its size...
 
I like those Nazca Lines
 
Thanks again.

Looking for beta testers for this:

AI build projects automatically

Purpose: Get rid of current system which is done under def AI_chooseProduction

Old System:
1) Forces AI to build under certain circumstances, interrupting normal AI decisions
2) Extra python codes for no real benefits = extra performance lags, especially as AI are chosing production every turn, this command is activated every turn.
3) AI may be doing something important like building a wonder, yet this will force it to change.
4) Even after we force AI to start building the project, AI may switch away from completing the project.

New System:
1) Codes only activated when project finished. Thus, once in a lifetime. Less performance issues. In fact, there is only 1 real line of code.
2) AI "sees" the project as another Internet project, so it won't make funny decisions such as switching from a wonder that is 3 turns away to completion.
3) Since AI sees the project as another Internet, it will not switch away from it unnecessary.

Thus, this is to bluff AI to build the project "willingly and happily"

How it works/supposed to work:
There are 3 useless projects added, all buildable with Masonry.
Each of them has Internet effects, which are removed immediately when built.
Thus, it bluffs AI to build the projects willingly, thinking they are awesome Internets.
But once it is build, they get no benefits.

Need to test 4 things:
1) Each of them has iTechShare 1, which means you get all Techs known by ANY known player.
So to prove that the project is useless, you should NOT get any free techs which you don't have, but others have.
2) Internet still works, having iTechShare 2, which means you get all Techs known by any 2 known players.
Thus, you should still get free techs known by any 2 other players.
3) Leave 1 or 2 of the useless projects alone, and see if the AI build them happily
4) Doesn't matter whether Internet is built first, or useless project built first.

Notes:
Internet cost and prereq tech adjusted for easy testing.
Because the useless projects are using iTechShare, wordings for iTechShare are removed, and manually added into Internet's civilopedia
Treaty of Versailes is set as a Team Project, whereas the other 2 are World Projects to see if it works for both types.
In other words, each player can build 1 Treaty each
 
Channel Tunnel
Spoiler :



Mechanics:
Number of Tiles Unit can Move on Route = Greater of these 2:
A) 60 / iFlatMovement (6 For Railroad)
B) 60 * Moves / iMovement (20 For Railroad)

For unit with 1 movement, A = 10, B = 3.
Therefore, it can move 10 tiles.

For unit with 2 movement, A = 10, B = 6.
Therefore, it can move 10 tiles.

What Channel does is reduce iMovement of Railroad to 10.
For unit with 1 movement, A = 10, B = 10.
Therefore, it can move 10 tiles.

For units with 2 movement, A = 10, B = 12.
Therefore, it can move 12 tiles.

Thus, for modders, if you modified iMovement for Railroads, you have to modify channel codes to get what you want.
Else, channel may end up being OP, allowing units to move 60 tiles for instance

What it does
It places a 2nd Channel Tunnel at a coastal city of other players.
Friendly ones are considered first, followed by pleased ones.
The others are considered when there isn't any friendly or pleased ones.
Civs without coastal cities are out of consideration.
Coastal city chosen is most cultural one out of all coastal cities of chosen player.

No additional movement benefit for controlling both Channel Tunnels

Idea adopted from dacubz145
 
Top Bottom