Tsentom1 Python Traits

This is very easy to do yourself:

Just define specialunit_water for all ships and submarines.

And then edit CIV4SpecialUnitInfos.xml:

PHP:
		<SpecialUnitInfo>
			<Type>SPECIALUNIT_WATER</Type>
			<Description>INSERT_TXT_KEY_DESCRIPTION_HERE</Description>
			<bValid>1</bValid>
			<bCityLoad>0</bCityLoad>
			<CarrierUnitAIs/>				
			<ProductionTraits>
				<ProductionTrait>
					<ProductionTraitType>INSERT-TRAIT-NAME-HERE</ProductionTraitType>
					<iProductionTrait>INSERT-PRODUCTION-BONUS-HERE</iProductionTrait>
				</ProductionTrait>
			</ProductionTraits>
		</SpecialUnitInfo>
 
One question: How can improve mercantile the production? You get commerce from trade routes, no production. 1.2 x 0 is still 0 production. Or am I missing something?
 
One question: How can improve mercantile the production? You get commerce from trade routes, no production. 1.2 x 0 is still 0 production. Or am I missing something?

Mercantile is actually all XML so the confusing wording of the trait (20% of Food is Trade) is all firaxis' fault.

The way it works currently every 5 commerce a trade route makes (as 20% of a 100 is 5) you will also get 1 hammer and 1 food. This applies to all trade routes. It's generally weak late game but gets strong once you have harbors and custom houses.

If you want to change the percentages it's this section of the XML:

Code:
		<TraitInfo>
			<Type>TRAIT_MERCANTILE</Type>
			<Description>TXT_KEY_TRAIT_MERCANTILE</Description>
			<ShortDescription>TXT_KEY_TRAIT_MERC_MERCANTILE</ShortDescription>
			<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/>
[B]			<TradeYieldModifiers>
				<iYield>20</iYield>
				<iYield>20</iYield>
				<iYield>0</iYield>
			</TradeYieldModifiers>[/B]
			<CommerceChanges/>
			<CommerceModifiers/>
			<FreePromotions/>
			<FreePromotionUnitCombats/>	
		</TraitInfo>

I think the top one is food, then production, then commerce. I just forget off hand.
 
I would like a trade route type trait something like your mercantile, except i want it to give each city an extra trade route. I have looked at the trait xml tags and there doesn't seem to be a way to do it with just xml. buildings can be given extra trade routes such as the cothon and castle. do you think it might be possible to this for traits?
 
I would like a trade route type trait something like your mercantile, except i want it to give each city an extra trade route. I have looked at the trait xml tags and there doesn't seem to be a way to do it with just xml. buildings can be given extra trade routes such as the cothon and castle. do you think it might be possible to this for traits?

It would use the same exact code as the Scientific trait just instead of telling it to add a specialist you'd tell it to add a trait route. The command is something like:

pCity.changeExtraTradeRoutes(1)
 
It would use the same exact code as the Scientific trait just instead of telling it to add a specialist you'd tell it to add a trait route. The command is something like:

pCity.changeExtraTradeRoutes(1)

Thanks that's great.
 
This is very easy to do yourself:

Just define specialunit_water for all ships and submarines.

And then edit CIV4SpecialUnitInfos.xml:

PHP:
		<SpecialUnitInfo>
			<Type>SPECIALUNIT_WATER</Type>
			<Description>INSERT_TXT_KEY_DESCRIPTION_HERE</Description>
			<bValid>1</bValid>
			<bCityLoad>0</bCityLoad>
			<CarrierUnitAIs/>				
			<ProductionTraits>
				<ProductionTrait>
					<ProductionTraitType>INSERT-TRAIT-NAME-HERE</ProductionTraitType>
					<iProductionTrait>INSERT-PRODUCTION-BONUS-HERE</iProductionTrait>
				</ProductionTrait>
			</ProductionTraits>
		</SpecialUnitInfo>

cool thanks for that. Actually i will use this to give my religious trait a 25% bonus to missionaries as well, so double thanks.
 
Hi i have two more ideas for trait type modifiers...

1 - A trait that unlocks the number of specialists a city can have (like caste system civic.. eg. religious trait - unlimited priest specialists in city, or devious trait - unlimited spy specialists in city.

2 -a trait that modifies the commerce yeilds attached to specialists (like sistine chapel and representation civic) eg. religious trait - +2 culture per priest specialist, or Devious + 2 espionage per specialist, or indeed scientific trait - + 2 beakers per specialist.
 
Hi i have two more ideas for trait type modifiers...

1 - A trait that unlocks the number of specialists a city can have (like caste system civic.. eg. religious trait - unlimited priest specialists in city, or devious trait - unlimited spy specialists in city.

2 -a trait that modifies the commerce yeilds attached to specialists (like sistine chapel and representation civic) eg. religious trait - +2 culture per priest specialist, or Devious + 2 espionage per specialist, or indeed scientific trait - + 2 beakers per specialist.

Neither of those are possible without modding the SDK, well, unless you want to cheat like I did with my Nationalistic trait in Thomas' War, which basically you make an un-buildable building that does that and then have the trait give the building to every city.
 
Neither of those are possible without modding the SDK, well, unless you want to cheat like I did with my Nationalistic trait in Thomas' War, which basically you make an un-buildable building that does that and then have the trait give the building to every city.

ok nice work around.

btw i have tried out your scientific trait. and i have found it way too overpowered in the very early game. I mean a size 1 city with no infrastructure or improved tiles nonetheless gets an xtra pop that doesn't need feeding and bangs out more gpp than a world wonder? Coupled with philo it is just obscene. Getting 6gpp per turn from turn 1 without having to do anything means popping a scientist before anyone else has even started getting gpp the hard way by building wonders, infrastructure and giving up food to feed specialists...

scientific ought to be a trait that starts weak and gets stronger. rather than starts uber-powered and gradually fades to nothing.

Best way i can see to perfect it would be to make the free scientist available only if the city has a science specialist slot for it (eg. from library or caste system). To buff it in the late game you could give it dble prod on labs (well that is an easy xml job). So sci trait would be as weak as most of the other traits in the very early game and only start to become useful as infrastucture and tech options become available.

what do you think?
 
ok nice work around.

btw i have tried out your scientific trait. and i have found it way too overpowered in the very early game. I mean a size 1 city with no infrastructure or improved tiles nonetheless gets an xtra pop that doesn't need feeding and bangs out more gpp than a world wonder? Coupled with philo it is just obscene. Getting 6gpp per turn from turn 1 without having to do anything means popping a scientist before anyone else has even started getting gpp the hard way by building wonders, infrastructure and giving up food to feed specialists...

scientific ought to be a trait that starts weak and gets stronger. rather than starts uber-powered and gradually fades to nothing.

Best way i can see to perfect it would be to make the free scientist available only if the city has a science specialist slot for it (eg. from library or caste system). To buff it in the late game you could give it dble prod on labs (well that is an easy xml job). So sci trait would be as weak as most of the other traits in the very early game and only start to become useful as infrastucture and tech options become available.

what do you think?

Well someone requested it / the code which is why it is the way it is at the moment. I think they were using it for a specific scenario or something. As it stands it is more powerful than some of the traits (although you can't really use Phi as the reason as Ind/Phi is also overpowered, to counter that it's just not used in the game), but it's easy enough to modify.

I'm working on a more base civ friendly version to use in the next version of my big mod, which I'll post once I make it. The current version is up more cause the code is useful to use for a bunch of different things.
 
Well someone requested it / the code which is why it is the way it is at the moment. I think they were using it for a specific scenario or something. As it stands it is more powerful than some of the traits (although you can't really use Phi as the reason as Ind/Phi is also overpowered, to counter that it's just not used in the game), but it's easy enough to modify.

I'm working on a more base civ friendly version to use in the next version of my big mod, which I'll post once I make it. The current version is up more cause the code is useful to use for a bunch of different things.

Ok i my comments were only to be helpful. I really appreaciate the work you have done. Your wonders especially are excellent. thanks again.
 
cool thanks for that. Actually i will use this to give my religious trait a 25% bonus to missionaries as well, so double thanks.

I am wondering if a unit can belong to more than one special unit class. missionaries already belong to a special unit class (PEOPLE) along with spys and great people so they can ride in caravels while other units can't.
 
Ok i my comments were only to be helpful. I really appreaciate the work you have done. Your wonders especially are excellent. thanks again.

They were helpful. I didn't mean to come off otherwise...:sad:

And I'm not sure about units and more than one unit class. Offhand I'm going to say no. There is a way to do this in python, the problem being that it really slows down the game and it ends up not really being worth it.
 
Next question :): You said, that all traits could be converted to wonders.

Resourcefull has
PHP:
		iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_RESOURCEFUL')
		
		if (pPlayer.hasTrait(iTrait)):
			return 80	# 80% of normal cost

How can it be done?
Replacing all "Trait" with "Building" didn't work, but schema seems to be right for me.

Don't hit me, if it's a stupid question.
 
Next question :): You said, that all traits could be converted to wonders.

Resourcefull has
PHP:
		iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_RESOURCEFUL')
		
		if (pPlayer.hasTrait(iTrait)):
			return 80	# 80% of normal cost

How can it be done?
Replacing all "Trait" with "Building" didn't work, but schema seems to be right for me.

Don't hit me, if it's a stupid question.

I actually did this already with my Sphinx Wonder, just erase the line that looks only for wonder class buildings and it will apply to all buildings. I wouldn't use the unit cost one for a wonder though as it will increase the game turns a lot (since it'll have to perform the check a few times), but if you don't mind that it follows the same code really.
 
This was requested by someone a long time ago, I forget who.

Influential Trait

InfTrait.jpg


I have another more balanced Scientific Trait to release soon as well, as I wrote it for the next version of Thomas' War.
 
Back
Top Bottom