Changing Leader Traits?

Hankc

Warlord
Joined
Apr 25, 2009
Messages
125
Location
Where the dinosaurs roam
Earlier today I was poking around the xml-files for this mod, changing a few things. To my surprise the leaderheadinfo.xml contained mostly empty entries for the leaders. So how would one go about changing traits? I assume the relevant info are stored somewhere else?
 
Assets\Modules\NormalModules\FFHPLUS\Civs

Then go into the subdirectories to find the leaderhead XML files for each civ.
 
Sorry to resurrect this old thread, but it seemed appropriate for my question:
Is there any way to edit the traits themselves? Specifically, I really like the emergent trait, and I'd like to keep it when I get access to another, is there any way for me to do this?
(I know it would be overpowered, but I already play Lanun on archipelago maps, so, eh... I guess I'm finding something other than the challenge to enjoy about this mod? :) )
 
There is a file called traitinfos.xml in Wildmana\assets\XML that controls most of the traits. Emergent (minor in the xml), however, is controled from a file with the same name in Wildmana\assets\modules\loadordervitalmodules\firstload\wildmana\civilzation. At least I think so, there might be more traitinfo.xml files due to the modular nature of WM. It is possible however that making emergent permanent requires python, wich I know nothing about.
 
It is possible however that making emergent permanent requires python, wich I know nothing about.

Since when do you need to know anything about python? I have a 500-mega-monkey string generator I use for any python I need.

It came up with this rather quickly:

Code:
		if pPlayer.isHuman():
			pPlayer.setHasTrait(gc.getInfoTypeForString('TRAIT_MINOR'),True)

If added to onBeginPlayerTurn inside CvEventManager.py, it should assign "Emergent" to any human player each turn. (I retain a middle schooler to tell me where to put my monkey functions. I don't even have to pay him, as a 13 year old he just loves the job description.)

I tested enough to see that "Emergent" is added. I didn't check to see what happens when you add a trait via the normal Emergent mechanics. AFAIK "Emergent" should just keep coming back.



But I believe I *did* track down how "Emergent" gets removed. It turns out "TRAIT_MINOR" is "Emergent." (Those clever primates!) In the file CvRandomEventIngerface.py there's a bunch of "doAddX" functions, where X is a trait. The last line of each changes "TRAIT_MINOR" to False. Deleting those lines should keep Emergent around.

Not that I've tested that, either. I have to see if the machine generated another best-seller last night.

- John Grisham
 
Wow. Go into a sub-sub-subforum, ask a question about the programming of a relatively obscure feature, and have it answered completely within three hours. I'm seriously overwhelmed... Thanks a lot!
 
Back
Top Bottom