Tsentom1 Python Traits

tsentom1

Bubble Dragon
Joined
Jul 24, 2007
Messages
1,000
Location
New York
I've tried it out, and i have to say: great work :goodjob:!

I've looked into the code, and it seems to be very difficult?
How much did it take, to program that?

It's not that bad. I've been using Civ to teach myself Python kinda so after a while I can do it relatively quickly. The hardest part is figuring out the correct functions.

If you're looking to merge this, winmerge makes it really easy as it shows you exactly where to copy and paste.

Added:


Nomadic Trait


 
I would love a building production modifier in a trait.
 
As per request:

Resourceful Trait





Made it in two different flavors one lowering the cost of units the other buildings. (-20% Cost is equal to +25% production)

No matter how you make a production trait I feel it'll be very powerful. Hope it's useful.
 
It's easy to change to -10 or -15 % Cost. In the python currently you'll see it says return 80 (or 80% of the cost) just make it 90 or 85, etc. (then of course go into the xml text file and change the description)

Also, it won't show up as a +25% when hovering over your hammers in the city screen. Rather if you compare the actual hammer cost of the building or unit when selecting production it'll be lower.
 
It's easy to change to -10 or -15 % Cost. In the python currently you'll see it says return 80 (or 80% of the cost) just make it 90 or 85, etc. (then of course go into the xml text file and change the description)

I also think, that's no problem, but it'll just take some time to get it balanced.
But it'll be done :).
 
Oh, I can separate them if you want. In truth there a are ton of python wonders, buildings, civics in that thing that I wrote and have been just too lazy to separate.

My Mercantile is actually all XML.

My Nationalistic is half and half - but I kinda cheated with it (in how its accomplished but it works 100% so I guess that's in the eye of the beholder) which is why I never separated it.

The Barbaric trait in Thomas' War is also half and half python and xml. (No one uses Barbaric though, there are quite a few things programmed into Thomas' War that are hidden just because I never got around to assigning them to things).
 
Oh, I can separate them if you want.

I only wanted to know, if you're planning it.
would be nice, if you have the time.
If not, it's no problem (for me) to get it out of your mod (if you don't mind...).

In truth there a are ton of python wonders

Really!?! ;)

My Mercantile is actually all XML.

:hmm: ah, that's what
PHP:
<traderouteyields>
does, isn't it?

My Nationalistic is half and half - but I kinda cheated with it (in how its accomplished but it works 100% so I guess that's in the eye of the beholder) which is why I never separated it.

I think i have an idea of what you're meaning :D.

The Barbaric trait in Thomas' War is also half and half python and xml. (No one uses Barbaric though, there are quite a few things programmed into Thomas' War that are hidden just because I never got around to assigning them to things).

I'll look into it, let's see what can be found :cool:.
 
Greetings,

I have added those four traits above and I have to say I am quite pleased. Now you mentioned that there are other traits not yet separated for add-on, I am eagerly awaiting them in future.

On other hand, I actually thought there was already a Scientific trait but looking into original XML version from both vanilla, warlords, and bts folders, I can find none. Should there be a Scientific trait or is that already covered by other traits?

Come to think of it, I wonder what are other possible traits. Aside from Scientific, I am thinking of Innovative, Progressive, and so on. What else are possible, trait-wise?

Regardless, good work and thanks for those traits! =D

-Chief of Staff
 
Hey tsentom1, if you're taking requests I'd like a Progressive Trait. I'd like it to have a 10% Tech reduction cost, and +1 culture per religion (so state religion gives 2 culture, and non state religions 1), and religious buildings. I'm also wanting it to have no revolution penalties from non state religions, as per the Revolutions mod, though I'm pretty sure I could code that myself (and if not, I know where to start and what questions to ask to figure it out). If not, it's cool, just noticed you were taking requests, and this is one I'd like to add to the WolfRevolution mod, but don't really know how to go about doing it.
 
Hey tsentom1, if you're taking requests I'd like a Progressive Trait. I'd like it to have a 10% Tech reduction cost, and +1 culture per religion (so state religion gives 2 culture, and non state religions 1), and religious buildings. I'm also wanting it to have no revolution penalties from non state religions, as per the Revolutions mod, though I'm pretty sure I could code that myself (and if not, I know where to start and what questions to ask to figure it out). If not, it's cool, just noticed you were taking requests, and this is one I'd like to add to the WolfRevolution mod, but don't really know how to go about doing it.

Tech costs kinda baffle me in the python as I know exactly where I have to edit it but the code I write for it always works kinda weird. I have like 5 things half done with tech costs I'm still trying to clean up. So that might be a bit. Though if you're simply talking about a general +10% research bonus (not affecting the specific cost persay, I can do that easily with the XML. The religion thing I can probably do on begin player turn, scan cities, get number of religions, and add +1 culture per religion. Let me see how that code would work out.
 
Speaking of requests, it's really a simple matter to convert any of my wonders to civics to traits, etc. For the most part (there are a few exceptions mainly the ones that increase commerce on a tile type that's not ocean or river), so if people wanted me to do any of them I could.
 
Though if you're simply talking about a general +10% research bonus (not affecting the specific cost persay, I can do that easily with the XML. The religion thing I can probably do on begin player turn, scan cities, get number of religions, and add +1 culture per religion. Let me see how that code would work out.
How would you do this in the XML? Research bonus isn't in Traits, there is a tag in civics though. Also I've rethought it, and it would be more balanced to simply have it so non state religions produced +1 culture, rather then giving a bonus to religious buildings as well as the state religion. This would also give an advantage to choosing no state religion (such as the free religion civic, or just in general) as only no state religion would really give a noticeable bonus, a city in a civ with a state religion other then the state religion would still be helped, but it wouldn't be overpowered, as the original suggestion was. Anyway thanks for considering this trait.
 
How would you do this in the XML? Research bonus isn't in Traits, there is a tag in civics though. Also I've rethought it, and it would be more balanced to simply have it so non state religions produced +1 culture, rather then giving a bonus to religious buildings as well as the state religion. This would also give an advantage to choosing no state religion (such as the free religion civic, or just in general) as only no state religion would really give a noticeable bonus, a city in a civ with a state religion other then the state religion would still be helped, but it wouldn't be overpowered, as the original suggestion was. Anyway thanks for considering this trait.

Code:
			<iHealth>0</iHealth>
			<iHappiness>0</iHappiness>
			<iMaxAnarchy>-1</iMaxAnarchy>
			<iUpkeepModifier>0</iUpkeepModifier>
			<iLevelExperienceModifier>0</iLevelExperienceModifier>
			<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
			<iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
			<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
			<iMaxGlobalBuildingProductionModifier>0</iMaxGlobalBuildingProductionModifier>
			<iMaxTeamBuildingProductionModifier>0</iMaxTeamBuildingProductionModifier>
			<iMaxPlayerBuildingProductionModifier>0</iMaxPlayerBuildingProductionModifier>
			<ExtraYieldThresholds/>
			<TradeYieldModifiers/>
			<CommerceChanges/>
			[B]<CommerceModifiers/>[/B]
			<FreePromotions/>
			<FreePromotionUnitCombats/>



			<CommerceModifiers>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
			</CommerceModifiers>

In traits, any commerce (gold, research, espionage, culture) you can increase by a total percent. I forget which one is which, the first is gold and the last is espionage, so research is one of the middle ones
 
Thanks, I recognize that, same as buildings, and similar to terrain improvements, cool. Let me know if you figure out how to use python to make it so non state religions produce culture.
 
Top Bottom