How are mod values applied to the defaults? Does a modded value overwrite the entire element or just the attribute/node under the element?
Example:
Say I want to add the ability to raze a city almost right away, rather than after learning Fortifications as is it currently set.
The Fortifications TechDef contains the following modifier, which enables razing of a city.
<GameModifier>
<ModType>Player</ModType>
<Attribute>UnlockCityAction</Attribute>
<StrVal>Raze</StrVal>
</GameModifier>
For the purposes of this example, I want to attach the Raze ability to the Equipment TechDef (I guess a torch is now included in the equipment pile).
So I take a copy of the Techs_Amarian.xml file, place it in the mods directory, and tell the program to use the mods directory. Then I delete everything except the TechDef for Equipment from the copy so that the basic tech tree is going to be used for everything except this one item. Finally I add the highlighted lines to the TechDef (the description and AIData is snipped for brevity). This is the complete file at this point.
<?xml version="1.0" encoding="utf-8"?>
<Techs>
<TechDef InternalName="Equipment_Amarian">
<DisplayName>Equipment</DisplayName>
<Description>...</Description>
<Image>Weapons_Medallion_Full.png</Image>
<Color>182,7,3</Color>
<HotColor>255,48,0</HotColor>
<Rarity>100</Rarity>
<Category>Warfare</Category>
<Infinite>0</Infinite>
<AppearanceChance>100</AppearanceChance>
<AIData AIPersonality="AI_General">...</AIData>
<GameModifier>
<ModType>Player</ModType>
<Attribute>UnlockCityAction</Attribute>
<StrVal>Raze</StrVal>
</GameModifier>
</TechDef>
</Techs>
Now I would expect this to work, since the "Equipment_Amarian" TechDef has been completely changed, I will overwrite all attributes regardless of how they load the XML files. However, this is not optimal for me, since if StarDock changes something in the basic tech description (the image, colors, AIPersonality, etc) I would have to update my mod as well or else I would miss out on their changes. So I would rather have the file look like this, so it only changes exactly what I want to change. (Yes, I should change the Description to explain this change to the user, but ignore that for now)
<?xml version="1.0" encoding="utf-8"?>
<Techs>
<TechDef InternalName="Equipment_Amarian">
<GameModifier>
<ModType>Player</ModType>
<Attribute>UnlockCityAction</Attribute>
<StrVal>Raze</StrVal>
</GameModifier>
</TechDef>
</Techs>
Would this work? Would it add the new game modifier onto the existing base TechDef or would I end up with a TechDef that makes bad things happen since it doesn't have a DisplayName anymore, or an Image file? I'm guessing this won't work, but it would take an understanding of how the XML files are loaded and parsed to be sure.
TIA
-Sal