You didn't mention if you are using XML or SQL. My mind is grounded mainly in SQL because that's how I do all my updates (because in SQL you can test your code against the database without actually running the game).
Speaking from the database perspective/SQL:
- All of the "qualities" of a civ, ultimately come from a table called "Modifiers", which tells you which kind of modifier it is
- Many of items also have an entry on a table called "ModifierArguments," which tells you how much, which building, etc.
So for example, if the name of a modifier is MODIFIER_MAKE_STUFF_CHEAP (totally made up) then in the ModifierArguments table there is likely to be a few rows like this:
Code:
ModifierId Name Value
'MODIFIER_MAKE_STUFF_CHEAP' 'Amount' '50'
'MODIFIER_MAKE_STUFF_CHEAP' 'BuildingType' 'BUILDING_TEMPLE'
So to change this, you have a two part task:
- Find out the ModifierId for the ability
- Edit the entries in the ModifierArguments table that match that id
Keep in mind that many abilities have more than one Modifier. In the case of apply abilities to a leader or civ, these Modifiers are all rolled together in an object called a Trait.
- Modifiers do not attach directly to a leader or civilization. They are attached to "Traits" which in turn can be attached to either leaders or civs
- A trait becomes associated with a leader (versus the civilization itself) if it is listed in a table called LeaderTraits
- A trait becomes associated with a civilization are lised in a table called CivilizationTraits
The modifiers that are inside a Trait are attached to the trait using a table called TraitModifiers. I know this sounds confusing but its really very simple. The modifier we saw earlier called MODIFIER_MAKE_STUFF_CHEAP would appear in the TraitModifiers table next to a Trait. This just tells the game "This modifier is used inside of this Trait. When you apply the Trait to a leader or civilization, apply the Modifier."
Knowing all this, we can use SQL to come up with a map to any trait we want to find. Here's some code that would let you search for every CivilizationTrait. It lists the CivilizationTrait first.
Code:
-- Create a list of all Civilization Traits, followed by values from the Modifiers, ModifierArguments, TraitModifiers, and CivilizationTrait tables
SELECT CivilizationTraits.CivilizationType, * FROM Modifiers
INNER JOIN ModifierArguments on ModifierArguments.ModifierId = Modifiers.Modifierid
INNER JOIN TraitModifiers on TraitModifiers.Modifierid = Modifiers.Modifierid
INNER JOIN CivilizationTraits on CivilizationTraits.TraitType = Traitmodifiers.Traittype
I scroll down so we could see France.
Here's the same code for searching by Leader:
Code:
-- Create a list of all Leader Traits, followed by values from the Modifiers, ModifierArguments, TraitModifiers, and LeaderTrait tables
SELECT LeaderTraits.LeaderType, * FROM Modifiers
INNER JOIN ModifierArguments on ModifierArguments.ModifierId = Modifiers.Modifierid
INNER JOIN TraitModifiers on TraitModifiers.Modifierid = Modifiers.Modifierid
INNER JOIN LeaderTraits on LeaderTraits.TraitType = Traitmodifiers.Traittype
Now I realize those entries gave way too many results, so here I've changed the code to
just show the ModifierArguments we said earlier were important.
Code:
SELECT CivilizationTraits.CivilizationType, ModifierArguments.ModifierId, ModifierArguments.Name, MOdifierArguments.Value FROM Modifiers
INNER JOIN ModifierArguments on ModifierArguments.ModifierId = Modifiers.Modifierid
INNER JOIN TraitModifiers on TraitModifiers.Modifierid = Modifiers.Modifierid
INNER JOIN CivilizationTraits on CivilizationTraits.TraitType = Traitmodifiers.Traittype
Here's some of the results. Again, I've scrolled down so we can see France.
So basically what you can see is that to update France's ability to build wonders quickly, we actually need to update a whole bunch of ModifierArguments, one per building. For example, the ability to build Chichen Itza faster is done by a modifier called TRAIT_CHICHENITZAPRODUCTION. You'd need to update the 'Amount" fields on ModifierArguments table. Luckily that's easy code:
UPDATE ModifierArguments SET Value='100' WHERE ModifierId='TRAIT_CHICHENITZAPRODUCTION' AND Name='Amount' ;
You just need to do it for every building in the list. Most Traits dont have this many Modifiers, but you got lucky and picked one of the few that has a whole bunch
