Tsentom1 Python Traits

Nice idea, like all your ideas :goodjob:.

How will you see the "stronger vassals"?
What effects does it have?

It's basically the same code I wrote for the Topkapi Palace wonder where your vassals get a gold and combat experience bonus. It's not really that powerful but a nice little boost. I was trying to work a research bonus for them as well but the code kept on messing up so maybe I'll update it later. The main draw of the trait is supposed to be the golden age length. I don't know, maybe the trait is a little weak at the moment? Golden ages aren't that often, but with the trait you may make more anyway so it could balance out.
 
It's basically the same code I wrote for the Topkapi Palace wonder where your vassals get a gold and combat experience bonus. It's not really that powerful but a nice little boost. I was trying to work a research bonus for them as well but the code kept on messing up so maybe I'll update it later.

Ah, okay :).
I haven't tried out the topkapi palace, so i didn't know it (okay, i also thought there, that's a good idea, but had no deeper thoughts, how you realize it).

The main draw of the trait is supposed to be the golden age length. I don't know, maybe the trait is a little weak at the moment? Golden ages aren't that often, but with the trait you may make more anyway so it could balance out.

The GA-bonus is a good idea, yes. With good planing you can have 5 GAs, that are 40 rounds of higher production.
Does ist work together with the mausoleum of mausolos?
 
Ah, okay :).
I haven't tried out the topkapi palace, so i didn't know it (okay, i also thought there, that's a good idea, but had no deeper thoughts, how you realize it).

The GA-bonus is a good idea, yes. With good planing you can have 5 GAs, that are 40 rounds of higher production.
Does ist work together with the mausoleum of mausolos?

Well the code simply calls how many golden age turns the player should have so it should take into account if you have the mausoleum and your game speed and double the extra turns as well.
 
tsentom1,

As I look at your first couple lines of code on the Scientific Trait, I have a basic question:

player = PyPlayer(city.getOwner())
pPlayer = gc.getPlayer(city.getOwner())

Why the two variables?

I can see where you use pPlayer - and understand how you define it - I'm hung up on why "player" variable is used. and how the definition is different?

Sarge:gp:
 
tsentom1,

As I look at your first couple lines of code on the Scientific Trait, I have a basic question:

player = PyPlayer(city.getOwner())
pPlayer = gc.getPlayer(city.getOwner())

Why the two variables?

I can see where you use pPlayer - and understand how you define it - I'm hung up on why "player" variable is used. and how the definition is different?

Sarge:gp:

Uhmm, I'm not at my civ computer to check my code. If I never actually used it, then it's probably left over. Probably was going to code it one way, changed my mind and forgot to erase the original definition. I'll have to check when I get home.

edit:

Yeah, it was just left in and I forgot to erase it.
 
Seafaring Trait



I don't know how useful this is for the regular game, it was made for a very specific mod, still I figured some people would like it or at least salvage some code from it.

Bonus are pretty self explanatory, free sailing tech, +1 naval movement once you research astronomy, 25% faster caravels.

Anyway, hope someone can find some use for it and / or the code.
 
Nice again :goodjob:.

Would be nice, if i had a use for it, but there's really no way :D.

Yeah, again I was just releasing it for whoever can use it. The most useful part of the code (to scavenge) is probably:

Code:
				iSea = gc.getInfoTypeForString('DOMAIN_SEA')
				pTeam = gc.getTeam(pPlayer.getTeam())

				pTeam.changeExtraMoves(iSea, 1)

Which gives the extra moves to sea domain units. It's just a matter of changing the domain in the code and you can give or take away as many extra moves as you like to land units or air, sea, immobile units etc. (Though, I'm sure air and immobile would act weird since they have no movement points by default).
 
:hmm: i think, for the land-units it would be overpowered, and for other units (beside the naval, sure) it wouldn't make real sense.

I've looked at the API, it seems, there's no way to attach it to a unitclass :(.
But having not all components is not the worst thing.

(Though, I'm sure air and immobile would act weird since they have no movement points by default).

Walking rockets :D.
 
As per my request for a progressive trait, most can be done in the XML. But not loosing culture for non state religions will require Python or SDK work. You said you had this half going, any chance you could show me your code? Also I'm not averse to using the SDK myself, but I don't know how to go about starting this. Any advise or direction you could give me would be apreciated. As far as the trait I have in mind goes:

Progressive:
-Non State religion still produces culture (don't know how to do this)
-10% Science Bonus
-50% reduction of Revolution Index Penalty for non state religion *Refers to jdog's & glider's Revolutions mod. I can pretty much write this bit up myself, though I need to know how to call for if the trait exists, would it just be if pPlayer.isHasTrait(gc.getTypeForString(Trait_Name)) ? Also How would I get this to print in the Civilopedia and hover text display?
-Reduced building cost of University, Industrial Park, and Hydro Dam.
 
I've got a trait request:

Cunning

When declaring war or beeing declared war, the enemy falls into anarchy for 'X = number of his cities \2' (minimum of 1) rounds. If already affected by an anarchy, his anarchy length gets extended.

edit: hmmmm this trait would be useless vs spiritual leaders.
 
Another request:

Cruel

When capturing a city, all of your cities get +1 Happiness (if possible for X rounds) and all of your enemy's cities get +1 Unhappiness (if possible for X rounds).
 
Hey Tsentom, quick question. How do you get effects to print on in the Civilopedia, and flag hover?

I've added an effect that reduces revolution distance penalty by 1/2 to the imperialistic trait:
Code:
if( pPlayer.hasTrait(gc.getInfoTypeForString("TRAIT_IMPERIALIST")) ):
                cityDistModifier /= 2
Simple enough, but now how do I get it to show up on screen?
 
Hey Tsentom, quick question. How do you get effects to print on in the Civilopedia, and flag hover?

I've added an effect that reduces revolution distance penalty by 1/2 to the imperialistic trait:
Code:
if( pPlayer.hasTrait(gc.getInfoTypeForString("TRAIT_IMPERIALIST")) ):
                cityDistModifier /= 2
Simple enough, but now how do I get it to show up on screen?

They made this really easy in BTS by adding Help tags to the XML. You simply add it under the short description for traits, (for units and buildings and stuff you add it under the strategy text):

Code:
			<ShortDescription>TXT_KEY_TRAIT_AGR_SHORT</ShortDescription>
			[B]<Help>TXT_KEY_AGR_TRAIT_HELP</Help>[/B]
			<iHealth>0</iHealth>

Whatever txt file you put there will show up the same as the standard trait bonuses. To make it look the same just start the new text with [ICON_BULLET].
 
Tsentom, a favor to ask of you. I want to make an Efficient trait, where Golden Ages are plus 50 percent longer and Workers build improvements 20 percent faster. I'm using the influential trait to accomplish the first part, but could you maybe do the second part?

Thanks
 
Tsentom, a favor to ask of you. I want to make an Efficient trait, where Golden Ages are plus 50 percent longer and Workers build improvements 20 percent faster. I'm using the influential trait to accomplish the first part, but could you maybe do the second part?

Thanks

There's no real way to give global worker speed with just python. The only possibility would be to "cheat" so to speak, make a dummy building that gives the worker build speed bonus, then have the python give you that building when you build your first city. Then you would have to do a check every turn to see if you still have the building (in case your capital is captured), and if not, replace it in your capital.
 
Hey Tsentom, quick question. How do you get effects to print on in the Civilopedia, and flag hover?

I've added an effect that reduces revolution distance penalty by 1/2 to the imperialistic trait:
Code:
if( pPlayer.hasTrait(gc.getInfoTypeForString("TRAIT_IMPERIALIST")) ):
                cityDistModifier /= 2
Simple enough, but now how do I get it to show up on screen?

Ok, this works? Can you help me by telling me where to put this code? My mod is based around RevDCM, and I wanted to make some rev specific trait stuff.
 
Revolution.py in the gameready folder of the revolutions python folder. You'll find the way revIdx is calculated in there. Also see the Revolutions forum, in the What's Up with City Distance Calculation? thread.
 
Top Bottom