Unexplained Traits Problem

Flying Pig

Utrinque Paratus
Retired Moderator
Joined
Jan 24, 2009
Messages
15,647
Location
Perfidious Albion
I'm running Civ 4 complete, and tried to add a trait 'Espionage'. I added it into the civ 4 XML/Civilisations folder, no problem, and then tried to add the following text to the Spy unit:

Code:
<ProductionTraits>
				<ProductionTrait>
					<ProductionTraitType>TRAIT_SECRETIVE</ProductionTraitType>
					<iProductionTrait>25</iProductionTrait>
				</ProductionTrait>
			</ProductionTraits>

It gave the error message "TRAIT_SECRETIVE is invalid" or something, then crashed. What is wrong?
 
Keep all changed files in your mods folder in Civ4-Installpath/Beyond The Sword7Mods, always! Otherwise you may overwrite files with buggy versions and that can cause Civ4 to stop working.

I'd also think that Gurra is right or that it is something similar to that. You wrote...
I'm running Civ 4 complete, and tried to add a trait 'Espionage'.
In the listing and the error message the trait secretitive is mentioned. Well, if you say you have checked this, then it may not be that easy indeed. To be honest I never modded traits by my own, but in general it is good to have lots of code others can check. For example it would be of interest how you have coded the espionage trait, so post what you have written in CIV4TraitInfos.xml.
 
<TraitInfo>
<Type>TRAIT_SECRETIVE</Type>
<Description>Espionage</Description>
<ShortDescription>Esp</ShortDescription>
<iHealth>0</iHealth>
<iHappiness>0</iHappiness>
<iMaxAnarchy>-1</iMaxAnarchy>
<iUpkeepModifier>0</iUpkeepModifier>
<iLevelExperienceModifier>0</iLevelExperienceModifier>
<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
<iGreatGeneralRateModifier>10</iGreatGeneralRateModifier>
<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
<iMaxGlobalBuildingProductionModifier>0</iMaxGlobalBuildingProductionModifier>
<iMaxTeamBuildingProductionModifier>0</iMaxTeamBuildingProductionModifier>
<iMaxPlayerBuildingProductionModifier>0</iMaxPlayerBuildingProductionModifier>
<ExtraYieldThresholds/>
<TradeYieldModifiers/>
<CommerceChanges>
<iCommerce>0</iCommerce>
<iCommerce>0</iCommerce>
<iCommerce>0</iCommerce>
<iCommerce>2</iCommerce>
</CommerceChanges>
<CommerceModifiers/>
<FreePromotions/>
<FreePromotionUnitCombats/>
</TraitInfo>
 
It is. Do I need to copy the TraitsInfo file over to the BTS folder?
This is your problem. The preferred method, which will not alter any game files, is to use the "Mods" folder for mods. If you do this, the game will use your modded file. If you still decide not to do this, know that you have modded the Vanilla file, while BTS uses the Warlords file.

Incidentally, if you were to copy the altered file into the BTS folder you'd discover this error reporting for Imperial, Charismatic, and Protective. Actually, you'd probably run into some problems with the schema as well. So don't do that. Copy the file from Warlords.
 
Surely then it will not contain my data? The TraitsInfo file, when in the BTS folder, is fine.
Obviously you need to put your data into the Warlords file. If you simply copy the vanilla file it will not contain other data, chiefly those traits added with Warlords.
 
Back
Top Bottom