Platyping's Python

Hmm, I think you can try with the original codes first with the project rather than as the wonder.
See if it crashes for you when you import it to your mod, since it works for me as a standalone.

Lack of creativity recently, so you see terrain ones once in a blue moon :D
 
Question:

PHP:
	def onFirstContact(self, argsList):
		'Contact'
		iTeamX,iHasMetTeamY = argsList
## Faithful Trait Start ##
		pTeam = gc.getTeam(iTeamX)
		if pTeam.isVassal(iHasMetTeamY):
			pPlayer = gc.getPlayer(pTeam.getLeaderID())
			if pPlayer.hasTrait(gc.getInfoTypeForString("TRAIT_FAITHFUL")):
				pPlayer.changeStateReligionUnitProductionModifier(10)
				pPlayer.changeStateReligionBuildingProductionModifier(10)
## Faithful Trait End ##
		if (not self.__LOG_CONTACT):
			return
		CvUtil.pyPrint('Team %d has met Team %d' %(iTeamX, iHasMetTeamY))

What does this do? Is this for newly created players by colonization?
 
Yup
The only way a team that meets a new team and is a vassal is when colonization occurs
 
Temple of the Inscriptions
Spoiler :
Civ4ScreenShot0000-17.jpg

Not a free GP like others, else it makes some like School of Confucious looks inferior.
It immediately brings the city GP points to the max so that GP is born next turn every 394 years.
Thus, if this city has 80% chance of producing prophet, it has 80% chance prophet as well.

Artwork by Hrochland


Edits:
Mercantile Trait: Removed Food Bonus
Traits and Gigapack updated
 
@dacubz
Not sure what you meant by asking me to do a mayan one... because this IS a mayan wonder.

@The_J
Yeah I know :D
This was meant to imitate G&K Mayan power

@2012
Well since first of all, my intention was to imitate G&K Mayan power, it has nothing to do with 2012.
Secondly, most games are finished long before 2012...
 
Enslaver Trait
Enslaver.jpg

Slavery is a common modcomp, so I just turn it to trait with some requirements that's all.
Upon victory, 25% to get a free worker (or fast worker for India)
Defeated unit must be non-mechanical, doesn't make sense to turn a catapult into a worker.

As a add-on feature, you get culture bonus when hurrying with population.
Amount depends on city population and gamespeed.
Formula:
City Pop * 5 * Gamespeed modifier
 
Actually, it will be fun if you can have a leader with 2 random traits :D
 
How does the maya count (temple of inscriptions) work? The ingame counter for the turnyear differs depending on gamespeed. And how does it handle the time B.C.?
 
Based on year, not turns.
Thus, on faster gamespeed, since time flies faster, you get the GP output faster as well.

4000 BC = -4000

In theory, you get the bonus at these time intervals:
AD 0
AD 394 and 394 BC
AD 788 and 788 BC
etc

Of course, if current game year is AD 390 and next turn is AD 400, you will get the bonus at AD 400 (the GP bar of wonder city will be filled) and the GP will be born the following turn
 
I see, thats the reason for the ">" in

PHP:
CyGame().getTurnYear(iGameTurn + 1) > self.TempleInscriptions[0]
right?

But why +1? I would be thinking of
PHP:
CyGame().getTurnYear(iGameTurn) >= self.TempleInscriptions[0]
- Why don't you use onBeginGameTurn? Is there no birth at the moment of a full filled GP bar?
 
Because when it is turn X year ABCD, it actually returns the year for turn X-1.
I tried begin and end, both give me same results
 
Wow, such a nice wonder pack :goodjob:
If you are interested in adding more wonders, we have a couple in RFCE which I didn't see here
St Sophia (Kiev), Bibliotheca Corviniana and Pressburg Castle (Hungary), Round Church (Bulgaria), Kazimierz (Poland), La Mezquita (Cordoba/Spain), Stephansdom (Austria), Paço da Ribeira (Portugal), Kalmar Castle (Sweden), Theodosian Walls (Byzantium), La Lanterna and Palazzo San Giorgio (Genoa), Chateau de Fontainebleau and Cluny Abbey (France) just to name a few
 
Thanks, will look to them when I have time.

Currently 1) Buzy with RL job earning $$$
2) Running out of new ideas to do. I tried not to have 2 similar wonders where A is just adding culture to courthouses, while B is adding culture to granary for instance.
So after doing 170+ or so, hard to do totally new stuff :D

Python is quite restricted
 
I know :( why didn't they just expose everything to python?!
 
Hi platyping,

nice stuff you have here! I'm getting a weird bug with your Tsikuji Fish Market. Debugging shows me that the for clause isn't working correctly, the iterations stop because the "list index is out of range" - sometimes after two, sometimes after six iterations, meaning not all city plots are checked. And I don't get why...
 
Thanks for the complements.
No idea either, because I seldom use that city index for loop myself.
Only saw it being used by jamie for his natural wonder codes, so use it to replace my own for loop since it seems shorter.

But if it is causing problems, try using my original loop:
Code:
			iX = pCity.getX()
			iY = pCity.getY()
			for x in range(iX - 2, iX + 3):
				for y in range(iY - 2, iY + 3):
					if abs(x - iX) != 2 or abs(y - iY) != 2:
						pPlot = CyMap().plot(x,y)
						if pPlot.isWater() and  pPlot.getBonusType(-1) == -1:
							randBonus = CyGame().getSorenRandNum(15, "Freebie")
							if randBonus < 3:
								pPlot.setBonusType(MarineResource[randBonus])
								pPlot.setImprovementType(fboat)
								CyInterface().addMessage(iPlayer,true,15,CyTranslator().getText("TXT_TSUKIJI_BONUS",(gc.getBonusInfo(MarineResource[randBonus]).getDescription(),)),'',0, gc.getBonusInfo(MarineResource[randBonus]).getButton(),ColorTypes(11), x, y, true,true)
## Tsukiji Fish Market End ##

It may be clearer if you enable python exceptions to see exactly which line went wrong because the list index may be pointing to MarineResource rather than the for loop

This is under onBuildingBuilt, the rest of the codes shouldn't be causing problems.
 
Back
Top Bottom