How can i edit leader traits?

Miselius

Chieftain
Joined
Nov 20, 2006
Messages
9
Im thinking to add few new leader traits, but i don't know how to.
Can anyone help me, please?
 
please can someone help id like to know aswell
 
Make a new trait or add an existing trait to a leader?
 
Im thinking to add few new leader traits, but i don't know how to.
Can anyone help me, please?

Hello. I have been lurking in the shadows and using this site as a reference while I've been constructing an ever-growing mod. I feel like I owe something to the boards, so I've been looking for a post I can answer, and, at long last, I've found one!

If you are new to modding, I'd suggest looking at one of the many "intro to modding" type posts before beginning. The most important thing is to not overwrite the original files in your Assets folder. Before doing anything, create a new sub folder in the Mods folder of your Civ 4 directory, which is probably located here:
Program Files\Firaxis Games\Sid Meier's Civilization 4\Mods

As you find files that you would like to modify, save a copy to your Mods\YourMod folder, being sure to preserve the exact file tree. For instance, if you are modifying an XML file located in Assets\XML\Buildings\, you would place your modified file in Mods\YourMod\Assets\XML\Buildings\.

You can edit XML files with a basic text editor - I use Crimson Editor (freeware - http://www.crimsoneditor.com/) for HTML, and find it works great for XML also. (Turn on Word Wrap and Line Numbers under the View menu for improved readability and navigation.) There are lots of XML syntax resources, so I'm not going to bother with that here.

OK, let's get going! Here are each of the files that pertain to the leader traits.

***Assets\XML\Buildings\CIV4BuildingInfos.xml
Use the <ProductionTraits> tag to specify which buildings are built at double speed for each trait. (View spoiler for code sample).

Spoiler :

For instance, this excerpt for a University shows that Philosophical leaders enjoy a 100% production increase for this building.

<ProductionTraits>
<ProductionTrait>
<ProductionTraitType>TRAIT_PHILOSOPHICAL</ProductionTraitType>
<iProductionTrait>100</iProductionTrait>
</ProductionTrait>
</ProductionTraits>

A building that offers no leader trait bonus would have this tag instead:
<ProductionTraits/>


***Assets\XML\Civilizations\CIV4LeaderHeadInfos.xml
Each leaders' traits are specified here in the <Traits> tag.

Spoiler :

Peter is both Philosophical and Expansive. Here is the code governing his traits:
<Traits>
<Trait>
<TraitType>TRAIT_PHILOSOPHICAL</TraitType>
<bTrait>1</bTrait>
</Trait>
<Trait>
<TraitType>TRAIT_EXPANSIVE</TraitType>
<bTrait>1</bTrait>
</Trait>
</Traits>

I've never tried removing traits from a leader, but that'd be an interesting way to cripple your least favorite leader opponent.


***Assets\XML\Civilizations\CIV4TraitInfos.xml
This file specifies the characteristics of each trait. The best way to understand the tags used here is to compare the leader trait description in the manual (p159) to each trait's code.

Spoiler :

Sticking with the Philosophical trait, we can see that the <iGreatPeopleRateModifier> tag imparts the +100% Great People Birth Rate effect.

<Type>TRAIT_PHILOSOPHICAL</Type>
<Description>TXT_KEY_TRAIT_PHILOSOPHICAL</Description>
<ShortDescription>TXT_KEY_TRAIT_PHILOSOPHICAL_SHORT</ShortDescription>
<iHealth>0</iHealth>
<iMaxAnarchy>-1</iMaxAnarchy>
<iUpkeepModifier>0</iUpkeepModifier>
<iGreatPeopleRateModifier>100</iGreatPeopleRateModifier>
...


If you are just tweaking existing traits, the files detailed above are the only files you need!

If you are adding new traits, you will need to create new entries in the files above (just copy and paste a complete set of code, change the trait name wherever it appears, and update the values). You will also need to edit the following two files:

***Assets\XML\Text\CIV4GameText_Misc1.xml
Use this file to edit or define the short text key for a trait. The <ShortDescription> tag in the CIV4TraitInfos.xml file refers to this file - this is what text shows up when the short description is called in-game.

Spoiler :

<TEXT>
<Tag>TXT_KEY_TRAIT_PHILOSOPHICAL_SHORT</Tag>
<English>Phi</English>
<French>Phi</French>
<German>Phi</German>
<Italian>FIL</Italian>
<Spanish>Fil</Spanish>
</TEXT>

In theory, you should include translations for any new text you add. However, in practice, or in haste, you can skip the translations like so:

<TEXT>
<Tag>TXT_KEY_TRAIT_PHILOSOPHICAL_SHORT</Tag>
<English>Phi</English>
<French/>
<German/>
<Italian/>
<Spanish/>
</TEXT>


***Assets\XML\Text\CIV4GameTextInfos_Objects.xml
Use this file to edit or define the normal text key for a trait. The <Description> tag in the CIV4TraitInfos.xml file refers to this file - this is what text shows up when the description is called in-game.

Spoiler :

<Tag>TXT_KEY_TRAIT_PHILOSOPHICAL</Tag>
<English>Philosophical</English>
<French>
<Text>Philosophe:Philosophe:Philosophes:Philosophes</Text>
<Gender>Male:Female:Male:Female</Gender>
<Plural>0:0:1:1</Plural>
</French>
...

Again, translate for all languages, or dead-end the tags as demonstrated above.


Well, I think that's it! Happy Modding!

-Laina
 
Back
Top Bottom