Aussie_Lurker
Oct 26, 2006, 08:30 PM
Hi guys. Can anyone with more extensive knowledge than msyelf tell me where I can find the code relating to a leader's traits? I have tried various search terms within CvInfos, and can't find a thing. Any help would be appreciated.
Aussie_Lurker.
PeteT
Oct 26, 2006, 10:34 PM
In the class CvLeaderHeadInfo, traits are stored in the array: bool* m_pbTraits;
Each trait also has its own CvTraitInfo class.
Impaler[WrG]
Oct 27, 2006, 02:02 AM
Search for
CvTraitInfo::CvTraitInfo() : on the CvInfos.cpp that will take you to the start of the class, most TraitInformation is rolled into the Player object at the time the player is initialized, the boolean array that Pete is refering to is used mostly for display purposes and one or two functions like for one checking Production modifiers for Buildings and Units.
I've done a lot of tags for traits so I might already have what your looking for, If I ever get around to making the mod it will realy knock your socks off.
I also have a very nice little feature adapted from the Scriptable Leader Traits mod by I cant remember who right now, basicaly its a ProcessTrait function very much equivilent in function to ProcessCivics, it takes the Trait and an int (1 or -1) and can thus give or take away a trait. All Trait processing is done through this one function, the player initialization now calls it. Its exposed to Python so traits can be modified on the fly.
Aussie_Lurker
Oct 27, 2006, 02:10 AM
Well, lets give it a shot. What I was hoping for was one of two things:
1) Code for producing a <CityMaintainanceModifier> tag in traits or
2) Code for producing a <CityAnarchyModifier> tag in traits.
If you already have either of these, I would be really chuffed :).
Aussie_Lurker.
Impaler[WrG]
Oct 27, 2006, 02:48 AM
You got me their, I haven't implemented either of them for Traits. The City maintance are you looking for Courthouse style "total maintance after Num + Distance is totaled" or the seperate Civics style kind. Theirs already an Anarchy Length modifier for Traits so I dont know what you mean by "City Anarchy" or what that would do as Anarchy is an inherently empire wide concept??
chuffed ? Oh Crikey Mate I can only assuem thats something good from the use of the :)
Aussie_Lurker
Oct 27, 2006, 10:49 AM
By city anarchy, I meant the anarchy you get after you conquer a city. As for maintainance, either type (or both types) would be fine.
Aussie_Lurker.
Impaler[WrG]
Oct 27, 2006, 04:00 PM
Thats refered to as Resistence or Occupation, interesting idea for a modifier though.
Aussie_Lurker
Nov 06, 2006, 06:30 AM
Hey, thought I would ressurect this thread to ask: Does anyone know how they deal with 'cultural assimilation' in Civ4? i.e. what calculates the rate at which % ethnicity of a city changes?
Aussie_Lurker.
Lord Olleus
Nov 06, 2006, 12:43 PM
Its exactly the same as culture. If a city had 900 Aztec culture, then the Romans conquer it and x turns later the romans have pumped out 100 culture, the city is 10% Roman and 90% Aztec. Thats why its almost impossible for a conquered city to have 100% ethnicity (its only really due to rounding error).