Sevopedia Traits Section

Voyhkah

Undead
Joined
Apr 25, 2009
Messages
1,444
Location
Earth
How do I make the sevopedia show the new leader traits I've added?
 
There are 3 files you need to edit.

1) Assets\Python\BUG\TraitUtil.py
In the init function add your new traits like the original ones are added via the addTrait function calls. This involves assignign an icon to each one (symbols from the gamefont file). Pick ones that is in some way are a bit representative of each trait, like the existing ones do. Note that the existing ones get icons using two different methods, game.getSymbolID or gc.getCommerceInfo depending on what the symbol is. You also need to pick a button sized graphic that is shown on the 'pedia page. The existing ones use a variety of buttons that already exist, from promotions, techs, and things like that. The Final Frontier Plus mod uses the civilization's symbols since the traits are all named after the civilizations (and draws them from the relevant atlas, so I know the atlas style specification works here too).

2) Assets\XML\BasicInfos\CIV4NewConceptInfos.xml
You need to add entries for each new trait in the section of the file with the existing ones. The text keys need to be named using the "CONCEPT_TRAIT_" prefix and they also have to be in the file in alphabetical order. Pick names for text keys that are specified in here. The first one, Description, should already exist (the text key for the name of the trait) so you should use the existing value here. The second one should be pattered after the existing ones. You'll add the actual text in the next section.

3) Assets\XML\Text\TraitsPedia_CIV4GameText.xml
Add the new text key for each new trait that was used in step 2, like the ones that are already in here.
 
How do I assign a gamefont symbol (file 1)?
 
The same way it does for the others. For example, the aggressive trait uses this:
Code:
	addTrait("AGGRESSIVE", game.getSymbolID(FontSymbols.STRENGTH_CHAR), "Art/Interface/Buttons/Promotions/Combat1.dds")
This gives the aggressive trait the symbol that is used next to the unit strength values (the bent arm, presumably flexing its bicep). It also assigns it the button used for the combat 1 promotion. Note: the "AGGRESSIVE" part is the name of the trait with the "TRAIT_" prefix removed, as per the Type tag in its entry in CIV4TraitInfos.xml.
 
Top Bottom