Platyping's Python

Hi,

I got another error, this time the function onUnitSpreadReligionAttempt. iPlayer is not defined although it´s used for the message for the Famen Temple:

Code:
	def onUnitSpreadReligionAttempt(self, argsList):
		'Unit tries to spread religion to a city'
		pUnit, iReligion, bSuccess = argsList
		
		iX = pUnit.getX()
		iY = pUnit.getY()
		pPlot = CyMap().plot(iX, iY)
		pCity = pPlot.getPlotCity()
	
		pPlayer = gc.getPlayer(pUnit.getOwner())
## Famen Temple Start ##
		if not bSuccess:
			if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_FA_MEN_SI")) == 1:
				pCity.setHasReligion(gc.getUnitInfo(pUnit.getUnitType()).getPrereqReligion(), true, true, true)
				CyInterface().addMessage([COLOR="Red"]iPlayer[/COLOR],true,15,CyTranslator().getText("TXT_FAMEN_SUCCESS",(pCity.getName(),)),'',0,'',-1,-1,-1, true, true)
## Platyping Wonders End ##

I think I fixed it for myself, but I´m sure you want to now things like that.:)
 
This should work:
Code:
## Tlaloc Shrine Start ##
		if bSuccess == false:
			iPlayer = pUnit.getOwner()
			pPlayer = gc.getPlayer(pUnit.getOwner())
			pTeam = gc.getTeam(pPlayer.getTeam())
			obsoleteTech = gc.getBuildingInfo(gc.getInfoTypeForString("BUILDING_TLALOC_SHRINE")).getObsoleteTech()
			if pTeam.isHasTech(obsoleteTech) == false or obsoleteTech == -1:
				bc_Tlaloc = gc.getInfoTypeForString("BUILDINGCLASS_TLALOC_SHRINE")
				if pPlayer.getBuildingClassCount(bc_Tlaloc) == 1:
					pCity.setHasReligion(gc.getUnitInfo(pUnit.getUnitType()).getPrereqReligion(), true, true, true)
					CyInterface().addMessage(iPlayer,true,15,CyTranslator().getText("TXT_TLALOC_SUCCESS",(pCity.getName(),)),'',0,'',-1,-1,-1, true, true)
## Tlaloc Shrine End ##
 
@Alrik
Yup I know about that, did an invisible fix in the packs recently.
It should follow the standalones.

iPlayer should be defined as pUnit.getOwner()
pPlayer = gc.getPlayer(iPlayer)

As for Arian, the obsolete tech part is required only if you decide to add an obsolete tech, else not necessary.
 
@Hrochland

If you want a Wonder to be buildable only if you have X Natural Wonders in your territory, the only way I can think of is a loop through the whole map, and count each NW and see if there are X or more, defined under cannotConstruct.

It is definitely doable but may not be great for performance.
I will suggest a simpler one:
So long as there is a NW in the BFC of the city, can build the wonder.

@Jamie
This is your job :D
 
so.... I think I added stuff in the Natural Wonders SDK for this? maybe it didn't work and I disabled it. But I made a C++ tag which keeps track of the number of natural wonders a player has under their control. I will see if I still have it later and if it works it would be reaaaaaly easy to implement this... Not sure how accurate the system was though :p
 
Wow - it sounds good :) platyping explained to me some time ago that things made with SDK make not game slower . All right. Do it, please, if you have time . Thank you.
 
not strictly true ;). C++ can make the game slower but it is over a 1000 times faster than python. So there is no way anybody can see the difference in speed :lol:

anyway when I have some time I will do it! (you might have to wait a couple of weeks, if you don't mind)
 
Saint Stephen's Basilica! What a kind surprise! :D I've never thought this would ever become a wonder in Civ.

But I guess it has nothing to do with other religions than Christianity, so its trait, that every religion spreads in the city where it's built seems both strange and way too limited. I guess it makes the wonder pretty useless, because it'll be granted to city with at least 5 religions present, whilst there are 7 religions in Civ. Hence plus 2 religions will be spread to the city, that's not much, really. Also, if you don't have Free Religion adopted, +2 religions are totally useless.

Instead it should spread state religion to all of the cities, or make the city, where it is built, be the new Holy City of the state religion. Or both. I don't know if these are possible, I'm not knowledgeable about Civ's Python. But if something like that's possible, it would improve the wonder, definitely. ;)
 
Well, as it is an achievement, it is free, its benefits cannot be too much :D
The main benefit of it is the 2 free priests rather than the spread remaining religions.
That part is just an additional perk.
Since this achievement can be achieved quite early, 2 free priests seems quite decent enough I guess :D
Of course since the main benefit is XML stuff, you can further boost it easily, the python part is simply the granting part.
 
Mount Everest Expedition
Spoiler :
Civ4ScreenShot0008-11.jpg

Actually, I wanted to make mountains passable and I know there are some mods that have achieved that, but that requires SDK modifications.
Since this is a python only thread, so this is not quite possible, thus have to settle for something easier to implement.

I not sure if anyone here actually prefers mountains to hills, maybe to create choke point?
But personally I rather have a usable plot than a stupid mountain that can result in the volcanic event as well and blow up all my improvements.

So this project simply converts some mountains to hills, 33% chance. (I still want some mountains for beautiful scenary)
P.S.
Yes, I know climbing a mountain does not make it shorter, don't shoot me :D

Set as a team project, so everyone has a chance.


Countdown to 250: 9

By the way, is there any significant difference between Suez and Panama Canal?
Suez is another famous one that I always wanted to do, but lack of idea and artwork.
So if there is something different beside the location, maybe can crack some stuff
 
Chauburji
Spoiler :
Civ4ScreenShot0010-12.jpg

Doubles only the "local" benefits, does not include global benefits or benefits due to bonuses.
Initially I only wanted to double for health, but then there are only 3 buildings with that.
Takes care of happiness from traits as well.

Artwork by embryodead


Countdown to 250: 8
 
Thanks as always :D

Meenakshi Amman Temple
Spoiler :
Civ4ScreenShot0012-10.jpg

Applied to all cities all over the world, even those you have not met.
Anytime a religion is spread, both naturally and by missionaries, 25% chance to be replaced by our state religion instead.
The downside is that you still get the XXX religion is spread message, even though it is replaced.
So I added a message to inform the player it has been replaced.

Artwork by Hrochland


Countdown to 250: 7
 
Traits 3.0

Kinda bored, so decided to revise the traits.
21 Traits are too many, so cut down to 14 Traits in the pack.
1) Merge some traits together since some benefits are not that spectacular or too weak compared to the others.
2) Remove some traits that are simply copy and paste from existing wonders.
3) Remove those requiring callbacks from the trait pack.

Adaptive, Liberal , Conquerer Traits:
Spoiler :
Adaptive.jpg
Liberal.jpg
Conquerer.jpg

These 2 traits require callbacks.
Adaptive is simply a modified version of Banaue Rice Terrace which allows you to build improvements on certain terrain which does not allow usually.

Liberal is just an example how to use that callback, but not really useful as a trait, because it is totally useless when games start at later eras where those civics are available to all.

Both removed from pack, keep standalone for whoever interested.

Conquerer Trait is just a modified version of Women's Suffrage, taken out from pack temporarily till I can give it a new bonus


Protective Trait
Spoiler :
Protective.jpg
=>
Protective-1.jpg

1)There are only 3 features where you can build cities, forests, floodplains and jungles. Forests and Jungles are pretty much the same, provide defense.
2) Forests and Jungles can be chopped for hammers, so changed to Forts and AI will not be dumb enough to destroy own forts.
3) Now applied to captured cities as well, so it is a global 25% extra defense.
4) Features will make it difficult to merge with other wonders adding features. Forts won't, at least so far there isn't any adding improvements.


Airborne Trait
Spoiler :
Airborne-2.jpg

Added 50% faster production of air units
Seems pretty weak initially as a trait since it is only useful at late game, especially compared to the other enhanced traits.
Thus, gave it another bonus.


Aggressive Trait
Spoiler :
Aggressive.jpg
+
Enslaver-1.jpg
=>
Aggressive-1.jpg


Imperialistic Trait
Spoiler :
Imperialistic.jpg
+
Civ4ScreenShot0000-22.jpg
=>
Imperialistic-1.jpg


Industrious Trait
Spoiler :
Industrious.jpg
+
Builder.jpg
=>
Industrious-1.jpg

For those who forgot what the random buildings do, this benefit provide 1 random building based on era. Thus building a new city in classical era gets 2 random buildings.


Financial Trait
Spoiler :
Financial.jpg
+
Organized.jpg
=>
Financial-1.jpg

The new Trade Route bonus is applied to all cities rather than just coastal cities


Organized Trait
Spoiler :
Organzied.jpg

Modified benefit of old Industrious Trait


Adventurous Trait
Spoiler :
Seafaring.jpg
+
Nomadic-1.jpg
=>
Adventurous.jpg

Both traits look pretty situational and weak on their own.
Seafaring is totally useless trait in maps with little or totally no water at all.
Nomadic is only useful in early games since end game has no more tribal villages and mounted units expire.
Thus, 2 not so useful traits merged into 1 trait. The python part of seafaring is just a duplicate of Magellan's Voyage, so removed it and gave it morale promotion so they explore faster
 
Definitely using that new Airborne Trait. I've also been making use of your Liberal and Adaptive traits.
 
Back
Top Bottom