Creating new Leader Traits?

pvtNobody

Chieftain
Joined
Jan 30, 2009
Messages
3
Hello all,

I've been coming to the site for some time for references and downloads but never took the time to register or contribute. I'm not sure whether this is the proper place for this question or not so if I'm in the wrong place please redirect me.

My goal is this, I'm often frustrated by the lack of a "republic" era Rome. We're left with the Roman Empire rather than the republic that built that empire through trust and friendship. I would like to create a new leader for the Roman civ that reflects the earlier republic. Ideally this leader would be defensive and another trait that I would describe as "trustworthy" that gives the civ a diplomatic bonus (i.e. automatically makes other civs more amiable towards them). With the resources described throughout this site I'm confident that I can accomplish all but the last. How difficult (or even possible) would it be to create a new leader trait and how would I accomplish the stated effect?
 
First off, welcome!

To answer your question, yes, it's quite possible to add new leader traits. However, to help you further, you need to give a bit more details as to what you're thinking. Would you give this leader a +1 relationship boost with all civs? What else would this leader get (because I can't really think of anything else, and that doesn't seem like enough)?

Also, sort of a side note, but I wouldn't call the new Trait "trustworthy", basically because some players would not be trustworthy at all. Though if that doesn't bother you, then I wouldn't worry about it.
 
Well essentially I want to create a leader that is modeled after the mentality of the republic, that is make lots of allies so that no one can challenge the homeland. Historically the Romans did this by being known far and wide for coming to the aid of their allies and treating everyone (even defeated foes) fairly.

So that's the mentality. I'm not terrible knowledgeable about the underlying mechanics of Civ4 so it's hard to translate those ideas into specific modifications. Specifically I would want other civs to be more willing to engage in typically "risky" agreements (open borders, mutual protection, vassalage, etc.). The leader's reputation as being "trustworthy" would give him an advantage at negotiating trades. Obviously a player could act untrustworthy but that would have negative effects diplomatically as usual (at least the way I understand it).
 
The way i see it, it's not a Trait-thing (To do this via trait you would probably need to add a new XML field to the TraitInfos, which boils down to some SDK progarmming).

Trust is not somthing a leader just get. And even if he does get - say +5 initial stance bonus (which is huge) - a few dumb actions can negate it quickly. Not to mention it would not work at all vs. the human player.
"Thrustworthy" is about personality. Look at Mansa or Asoka AI personalities - the dudes get along with everyone nicely and are - generally - trusted.
 
If you wanted to do a Relations bonus for a trait. You could do this relatively easily with the onGameStart function of the EventManager python file.

Code:
         for iPlayerLoop in range(gc.getMAX_CIV_PLAYERS()):

			pPlayer = gc.getPlayer(iPlayerLoop)

			if (pPlayer.isAlive()):

				iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_WHATEVER')
			
				if (pPlayer.hasTrait(iTrait)):

Would check for the trait.

Then just loop through all the teams and use something like:

loopPlayer.AI_changeAttitudeExtra(iPlayer, +1)
pPlayer.AI_changeAttitudeExtra(iLoopPlayer, +1)

It'll show up in the game as a permanent "Past Events have something something +1" (I forget the exact wording)
 
Top Bottom