Modded xml files not activating

WesW

Creator of the Medmod
Joined
Mar 14, 2002
Messages
145
Location
Florence, AL.
My modded xml files are apparently not activating. To check and see if they were, I changed the strength of the Brute to 1 in the modded file, but in the game it still shows up with the default strength. Note that this is the only change I made to the default file.
Also note that I made the mod by taking the core game files, modding them, and sticking the entire file into the mod. Here is the relevant section of my info file:

<Files>
<File md5="B5C1A32610582CF401CB7159BEDD6ED7" import="0">CIV5Buildings.xml</File>
<File md5="236ECB342666EE881D677ACE704D24BA" import="0">CIV5Features.xml</File>
<File md5="EBAEC4E00C9DD7DA12865A3BF18FCF70" import="0">CIV5GameTextInfos_Jon.xml</File>
<File md5="E1D68CF95C95C0480C2ED4B2753635D2" import="0">CIV5GameTextInfos_Units.xml</File>
<File md5="CE6812C0681798E6D03A54414F2E6840" import="0">CIV5Improvements.xml</File>
<File md5="0220C442A3B1BEE61900D46176159EB2" import="0">CIV5Leader_Alexander.xml</File>
<File md5="1B5F9B5C7D66CB718B052C8F8E7BEB41" import="0">CIV5Leader_Askia.xml</File>
<File md5="4ACDEB1722CBC503CA70717BF7C5358E" import="0">CIV5Leader_Augustus.xml</File>
<File md5="EB66A3FDE8A345EAB1CC9D2ABE96B6E6" import="0">CIV5Leader_Bismark.xml</File>
<File md5="DF2BA62BC17B9962D093035C345D5009" import="0">CIV5Leader_Catherine.xml</File>
<File md5="C03EDFD765B98389EE491CD6EA0D12FC" import="0">CIV5Leader_Darius.xml</File>
<File md5="65C4CDAEEED99B1F1E4C2C44FB7E46E2" import="0">CIV5Leader_Elizabeth.xml</File>
<File md5="B659899BD96C449AA1D7B515D5FFEA36" import="0">CIV5Leader_Gandhi.xml</File>
<File md5="6B0E1D12C0D4EBB336FCBEDB7C0509FB" import="0">CIV5Leader_HarunAlRashid.xml</File>
<File md5="C8E84A397C8641FD0B9404B7514CE927" import="0">CIV5Leader_Hiawatha.xml</File>
<File md5="472F5E7F76A3D5F7A9E1F51E301DBD37" import="0">CIV5Leader_Montezuma.xml</File>
<File md5="A57CF9E9D2B63D6504BE16708344C39C" import="0">CIV5Leader_Napoleon.xml</File>
<File md5="04D9A60D62505E652FF0F5F0DCA3F4EE" import="0">CIV5Leader_OdaNobunaga.xml</File>
<File md5="1D7AA860A1705CE169F1EE136B7B10E7" import="0">CIV5Leader_Ramesses.xml</File>
<File md5="AE907237026507BC3E70EC95CECFC8FC" import="0">CIV5Leader_Ramkhamhaeng.xml</File>
<File md5="3959D2A1F74472980E7A3390076225FE" import="0">CIV5Leader_Suleiman.xml</File>
<File md5="9DB2C547AD6A5532AFDF56484D7003E4" import="0">CIV5Leader_Washington.xml</File>
<File md5="270005E7820542D95ECE0CD79824BAED" import="0">CIV5Leader_WuZetian.xml</File>
<File md5="B538F788AD0F427B45C98E75186511D9" import="0">CIV5Policies.xml</File>
<File md5="33D8733B480FD4790D4514616BF4B9A6" import="0">CIV5Resources.xml</File>
<File md5="65511025258335795B5B3B3EBF4FA46B" import="0">CIV5Specialists.xml</File>
<File md5="19FAA499DB9EAD042F5A8735F81C411E" import="0">CIV5Technologies.xml</File>
<File md5="95A3B86E4F35F3C33671A79AAD4A92B9" import="0">CIV5Terrains.xml</File>
<File md5="77E7DC56CD2D099EB0BDE1F88E287A78" import="0">CIV5Traits.xml</File>
<File md5="A256DA377F3B8679D44D88501BD4A234" import="0">CIV5UnitPromotions.xml</File>
<File md5="402E0BC8A4BA51B62F87B498DDEBF018" import="0">CIV5Units.xml</File>
<File md5="9869083FBCA58FF4A8E07BB5092C28EB" import="0">GlobalAIDefines.xml</File>
<File md5="77C8AB91CA91BDF7C197BB74A203A21E" import="0">GlobalDefines.xml</File>
</Files>
<Actions>
<OnModActivated>
<UpdateDatabase>CIV5Leader_Askia.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Alexander.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Augustus.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Bismark.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Catherine.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Darius.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Elizabeth.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Gandhi.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_HarunAlRashid.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Hiawatha.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Montezuma.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Napoleon.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_OdaNobunaga.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Ramesses.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Ramkhamhaeng.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Suleiman.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_Washington.xml</UpdateDatabase>
<UpdateDatabase>CIV5Leader_WuZetian.xml</UpdateDatabase>
<UpdateDatabase>GlobalDefines.xml</UpdateDatabase>
<UpdateDatabase>GlobalAIDefines.xml</UpdateDatabase>
<UpdateDatabase>CIV5Buildings.xml</UpdateDatabase>
<UpdateDatabase>CIV5Features.xml</UpdateDatabase>
<UpdateDatabase>CIV5Improvements.xml</UpdateDatabase>
<UpdateDatabase>CIV5GameTextInfos_Jon.xml</UpdateDatabase>
<UpdateDatabase>CIV5GameTextInfos_Units.xml</UpdateDatabase>
<UpdateDatabase>CIV5Specialists.xml</UpdateDatabase>
<UpdateDatabase>CIV5Policies.xml</UpdateDatabase>
<UpdateDatabase>CIV5Resources.xml</UpdateDatabase>
<UpdateDatabase>CIV5Terrains.xml</UpdateDatabase>
<UpdateDatabase>CIV5Technologies.xml</UpdateDatabase>
<UpdateDatabase>CIV5Traits.xml</UpdateDatabase>
<UpdateDatabase>CIV5Units.xml</UpdateDatabase>
<UpdateDatabase>CIV5UnitPromotions.xml</UpdateDatabase>
</OnModActivated>
</Actions>
</Mod>

I can't see anything wrong with the syntax, but of course that doesn't mean anything.:rolleyes: Any help would be greatly appreciated.
 
Also note that I made the mod by taking the core game files, modding them, and sticking the entire file into the mod.

Yeah, you just can't do that. That's your problem. Do it the right way (update tags for the ones you need changed) and it'll work.
 
Isn't there any way to add update tags to the beginning and end of files so that the game loads the contents between those tags? I tried this and it didn't work for me, but I don't see why not.
I went through the modder's guide again, and this stuff is just too complicated for non-programmers who want to make lots of small changes to many files.
 
Isn't there any way to add update tags to the beginning and end of files so that the game loads the contents between those tags?

No. There isn't.

Look, it's not that difficult. If you have a large number of changes, then you're either doing a lot of work and this little bit of overhead is nothing, or you're making some kind of consistent shift (like multiplying all tech costs by 2) that would be better done through SQL.

Also, you don't HAVE to follow the file naming convention with XML updates (unlike Lua, where you do). Say you want to add a new unit type. You can make a single XML file that looks like this:
Code:
<GameData>
  <Units>
    (stuff)
  </Units>
  <Unit_Flavors>
    (stuff)
  </Unit_Flavors>
  <Unit_ResourceQuantityRequirements>
    (stuff)
  </Unit_ResourceQuantityRequirements>

  <UnitClasses>
    (stuff)
  </UnitCasses>

  <Language_en_US>
    (stuff)
  </Language_en_US>
</GameData>

You'll note that I put the contents of the Units.xml table and the UnitClasses.xml table into a single file, along with all of the TXT_KEY definitions from the NewText directory. It will still work. I could call the file "Bob.xml" and it'd still work, because the OnModActivated command tells the engine to parse that file line-by-line for database updates.
The same goes for edits. If your file changes ten things in ten different files, you can still make the mod be a single file and just put all ten in there. In fact, this'd be a GOOD thing to do from the point of view of readability.

In fact, the core game already DOES this. You'll note that the Leaders files lack the usual table definition info at the top of each file; that's because they're actually only parts of a single larger table, and the table definitions are being loaded through a different file. But to the game there's no difference between one file and twelve, as long as all of the pieces are there when it assembles the database at runtime.
(The game also does this for some of the UI-related XML, like sounds and such. But that's a lot harder to edit.)

It's not difficult, and you don't have to be a professional programmer to do any of this right.
 
Thank you for the info and the example. I may try some stuff sometime, though I don't think you realize how complicated this can seem to an outsider, even someone like myself whose been modding for over a decade now. Just look at the dearth of comprehensive balancing mods out there, and I think it says a lot. The only one I'm aware of is Alpaca's PlayWithMe.
 
The only one I'm aware of is Alpaca's PlayWithMe.

There are many others. Thalassicus' balance mods are so popular (and extensive) that they have their own subforum, and if you look at his revision history and compare it to the contents of the last two patches... well, let's just say they're not dissimilar.

My own mod (Crazy Spatz's Alpha Centauri) actually consists of two separate mods: a Content mod that adds all the new units, wonders, techs, etc., and a Balance mod that changes a huge variety of basic gameplay mechanisms (in an attempt to ensure you REACH the future eras). So I'm not unfamiliar with the idea of editing things all over the place. (I also cribbed quite a few bits from Thalassicus' mods. I had to, since they're not very compatible with my own mods for various reasons.)

I know that there are others, but frankly, since I only ever use my own balance mod I'm not up to speed on the merits of the rest. So I'm not the best person to ask for a list. (And I NEVER use the in-game Mod Browser.)

And I'd hardly call myself a modding expert, given that Civ5 is pretty much the first game that I've seriously worked on modding, and that only started in what, October? (I made a few mods for Civ4, Fallout 3, etc. but only for my own use.) Okay, I WAS a professional programmer for a few years, so I'm not exactly typical, but I still got the hang of XML editing within a week or so. (It's the Lua that's been painful, and I'm about to jump into 3D unit models...)

It's really just not that tough once you get going on it; it's the getting started that's hard, and Kael's tutorial really helped me there. After all, in GameData XML there are only Table, Set, Where, Delete, Row, Update. That's the entire list of commands as far as I can tell. Obviously there's a lot of intricacies in how you use them, but it's not like learning a programming language; once you understand that Set, Where, and Delete are an AND format and know when to use Row vs. Update, you're practically done. (Most people won't need to add new Table entries.)

I'm not saying you should feel bad for not getting it, because anything new takes a little work to get the hang of. Just that, a week from now, you'll have no problems at all with it. It's just that fast.
 
If I get started on this, I'm going to need some help. I came up with 3 examples where I need help just off the top of my head. The good thing is that I've only updated data, never added anything new.
1)What's the syntax for updating multiple elements of a row, say the cost and combat strength of the warrior?
2)What about deleting stuff, such as deleting the cavalry's penalty versus mounted units?
3)I added multiple preqs for some of the military techs, such as Iron Working. Any trick to the syntax there?
 
If I get started on this, I'm going to need some help.

That's what we're here for. Well, that and the delightful decor.

1)What's the syntax for updating multiple elements of a row, say the cost and combat strength of the warrior?

The crude way would be to do it as two separate updates, but the fact is that Set, Where, and Delete all use an implicit AND syntax. So it'd be:
Code:
<GameData>
  <Units>
    <Update>
      <Set Cost="100" Combat="8"/>
      <Where Type="UNIT_WARRIOR/>
    <Update>
  </Units>
</GameData>

So this'd set the cost to 100 and the combat strength to 8 for any unit of type UNIT_WARRIOR. (If you wanted to include the UU variants, like the Mohawk Warrior, you'd change the where to <Where UnitClass = "UNITCLASS_WARRIOR"/> instead.)

You can take this as far as you want; in my mod, I think I have one or two Set commands that change 10 or more things at once. Just keep stacking more things on the Set line, and it works.

2)What about deleting stuff, such as deleting the cavalry's penalty versus mounted units?

Very easy. A Delete acts like a Where, except that you don't put it inside a Row or Update. So:

Code:
<GameData>
  <Units_FreePromotions>
    <Delete UnitType="UNIT_CAVALRY" PromotionType="PROMOTION_MOUNTED_PENALTY"/>
  </Units_FreePromotions>
</GameData>

Again, remember it's like a Where, where it's implicitly an AND. So you could delete all free promotions of Cavalry by just putting the first half of that, or remove it from all units that have it by removing the first half.

The only catch is that if you delete something in a table that uses an ID value (like the base Units, Buildings, Technologies, etc. tables; anything that has an actual "ID" row at the top of the file), then deleting an entry used to cause bad things to happen. They mostly fixed this in the last patch, but I'd still avoid this where possible; generally you can disable almost anything by setting its cost to -1, so there's no need to actually DELETE a unit or building if you want to remove it from play.

3)I added multiple preqs for some of the military techs, such as Iron Working. Any trick to the syntax there?

If you mean having a tech depend on more techs, then no, all you need to do is put a new Row into the Tech_PrereqTechs table, exactly like the current ones.
There are only two limitations:
1> A tech can't require more than four techs in the AND table (Tech_PrereqTechs), or three in the OR table (Tech_ORPrereqTechs) that almost no one ever uses. These values are given in GlobalDefines.
2> If a tech leads to techs at differing X values on the tech tree grid, it can screw up the dependency arrows. (Also, using the OR table doesn't draw any arrows at all.)
And I don't know what happens if you try mixing OR and AND.
 
Gee, that was fast!
Lotsa tricks hanging around these threads... search is your friend - and, to be honest -- be patient and study hard.
99% of the mods already available will lead you directly to the truth and necessary facts.
The guiding hands are located in the InGame_Browser - consistantly!
:D
 
Well, I finished the units and unit promotions xml, but when I tested the mod it still wasn't loading. Here is my info file:

<Files>
<File md5="BF38575EDD005CF04FF2A904AF18FE71" import="0">Units.xml</File>
</Files>
<Actions>
<OnModActivated>
<UpdateDatabase>Units.xml</UpdateDatabase>
</OnModActivated>
</Actions>
</Mod>

What I tested was to see if the mod updated the Brute. Here is that code:

<Update>
<Set Combat="5"/>
<Where Type="UNIT_BARBARIAN_WARRIOR"/>
</Update>

Here I have pasted in the entire file. Probably some problem with the file structure.
Btw, would someone email me their Terrain folder? When this last update came in, I started editing those files before I remembered to back them up. My email is wesw2005@hughes.net . Thanks in advance.
Spoiler :
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 4/5/2011 10:10:39 AM -->
<GameData>
<Units>
<Update>
<Set Moves="3"/>
<Where Type="UNIT_GREAT_GENERAL"/>
</Update>
<Update>
<Set Combat="72"/>
<Where Type="UNIT_MODERN_ARMOR"/>
</Update>
<Update>
<Set Combat="45"/>
<Where Type="UNIT_TANK"/>
</Update>
<Update>
<Set Combat="54"/>
<Where Type="UNIT_GERMAN_PANZER"/>
</Update>
<Update>
<Set Combat="27"/>
<Where Type="UNIT_RIFLEMAN"/>
</Update>
<Update>
<Set Combat="20"/>
<Where Type="UNIT_LANCER"/>
</Update>
<Update>
<Set Combat="20"/>
<Where Type="UNIT_OTTOMAN_SIPAHI"/>
</Update>
<Update>
<Set Combat="20"/>
<Where Type="UNIT_MUSKETMAN"/>
</Update>
<Update>
<Set Combat="20"/>
<Where Type="UNIT_AMERICAN_MINUTEMAN"/>
</Update>
<Update>
<Set Combat="24"/>
<Where Type="UNIT_FRENCH_MUSKETEER"/>
</Update>
<Update>
<Set Combat="20"/>
<Where Type="UNIT_OTTOMAN_JANISSARY"/>
</Update>
<Update>
<Set Combat="16"/>
<Where Type="UNIT_KNIGHT"/>
</Update>
<Update>
<Set Combat="16"/>
<Where Type="UNIT_SIAMESE_WARELEPHANT"/>
</Update>
<Update>
<Set Combat="16"/>
<Where Type="UNIT_SONGHAI_MUSLIMCAVALRY"/>
</Update>
<Update>
<Set Combat="15" ObsoleteTech="TECH_GUNPOWDER" GoodyHutUpgradeUnitClass="UNITCLASS_MUSKETMAN"/>
<Where Type="UNIT_LONGSWORDSMAN"/>
</Update>
<Update>
<Set Combat="16" ObsoleteTech="TECH_GUNPOWDER" GoodyHutUpgradeUnitClass="UNITCLASS_MUSKETMAN"/>
<Where Type="UNIT_JAPANESE_SAMURAI"/>
</Update>
<Update>
<Set ObsoleteTech="TECH_GUNPOWDER" GoodyHutUpgradeUnitClass="UNITCLASS_MUSKETMAN"/>
<Where Class="UNITCLASS_CROSSBOWMAN"/>
</Update>
<Update>
<Set ObsoleteTech="TECH_GUNPOWDER" GoodyHutUpgradeUnitClass="UNITCLASS_MUSKETMAN"/>
<Where Class="UNITCLASS_PIKEMAN"/>
</Update>
<Update>
<Set Combat="11"/>
<Where Type="UNIT_SWORDSMAN"/>
</Update>
<Update>
<Set Combat="11"/>
<Where Type="UNIT_IROQUOIAN_MOHAWKWARRIOR"/>
</Update>
<Update>
<Set Combat="13"/>
<Where Type="UNIT_ROMAN_LEGION"/>
</Update>
<Update>
<Set Combat="5"/>
<Where Type="UNIT_BARBARIAN_WARRIOR"/>
</Update>
<Update>
<Set Combat="6"/>
<Where Type="UNIT_BARBARIAN_SPEARMAN"/>
</Update>
<Update>
<Set Combat="10"/>
<Where Type="UNIT_BARBARIAN_SWORDSMAN"/>
</Update>

</Units>

<Unit_ClassUpgrades>

<Update>
<Set UnitClassType="UNITCLASS_MUSKETMAN"/>
<Where UnitType="UNIT_CROSSBOWMAN"/>
</Update>
<Update>
<Set UnitClassType="UNITCLASS_MUSKETMAN"/>
<Where UnitType="UNIT_CHINESE_CHUKONU"/>
</Update>
<Update>
<Set UnitClassType="UNITCLASS_MUSKETMAN"/>
<Where UnitType="UNIT_ENGLISH_LONGBOWMAN"/>
</Update>
<Update>
<Set UnitClassType="UNITCLASS_MUSKETMAN"/>
<Where UnitType="UNIT_PIKEMAN"/>
</Update>
<Update>
<Set UnitClassType="UNITCLASS_MUSKETMAN"/>
<Where UnitType="UNIT_GERMAN_LANDSKNECHT"/>
</Update>
<Update>
<Set UnitClassType="UNITCLASS_MUSKETMAN"/>
<Where UnitType="UNIT_LONGSWORDSMAN"/>
</Update>
<Update>
<Set UnitClassType="UNITCLASS_MUSKETMAN"/>
<Where UnitType="UNIT_JAPANESE_SAMURAI"/>
</Update>

</Unit_ClassUpgrades>

<Unit_FreePromotions>

<Row>
<Set PromotionType="PROMOTION_ANTI_MOUNTED_I"/>
<Where UnitType="UNIT_ARABIAN_CAMELARCHER"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SHOCK_1"/>
<Where UnitType="UNIT_HORSEMAN"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SHOCK_1"/>
<Where UnitType="UNIT_GREEK_COMPANIONCAVALRY"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SHOCK_1"/>
<Where UnitType="UNIT_KNIGHT"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SHOCK_1"/>
<Where UnitType="UNIT_SIAMESE_WARELEPHANT"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SHOCK_1"/>
<Where UnitType="UNIT_SONGHAI_MUSLIMCAVALRY"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SHOCK_1"/>
<Where UnitType="UNIT_LANCER"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SHOCK_1"/>
<Where UnitType="UNIT_OTTOMAN_SIPAHI"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SHOCK_1"/>
<Where UnitType="UNIT_CAVALRY"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SHOCK_1"/>
<Where UnitType="UNIT_RUSSIAN_COSSACK"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SHOCK_1"/>
<Where UnitType="UNIT_TANK"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SHOCK_1"/>
<Where UnitType="UNIT_GERMAN_PANZER"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SHOCK_1"/>
<Where UnitType="UNIT_MODERN_ARMOR"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SMALL_CITY_PENALTY"/>
<Where UnitType="UNIT_HORSEMAN"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SMALL_CITY_PENALTY"/>
<Where UnitType="UNIT_GREEK_COMPANIONCAVALRY"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SMALL_CITY_PENALTY"/>
<Where UnitType="UNIT_KNIGHT"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SMALL_CITY_PENALTY"/>
<Where UnitType="UNIT_SIAMESE_WARELEPHANT"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SMALL_CITY_PENALTY"/>
<Where UnitType="UNIT_SONGHAI_MUSLIMCAVALRY"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SMALL_CITY_PENALTY"/>
<Where UnitType="UNIT_LANCER"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SMALL_CITY_PENALTY"/>
<Where UnitType="UNIT_OTTOMAN_SIPAHI"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SMALL_CITY_PENALTY"/>
<Where UnitType="UNIT_CAVALRY"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_SMALL_CITY_PENALTY"/>
<Where UnitType="UNIT_RUSSIAN_COSSACK"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_CITY_PENALTY"/>
<Where UnitType="UNIT_TANK"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_CITY_PENALTY"/>
<Where UnitType="UNIT_GERMAN_PANZER"/>
</Row>
<Row>
<Set PromotionType="PROMOTION_CITY_PENALTY"/>
<Where UnitType="UNIT_MODERN_ARMOR"/>
</Row>

<Delete UnitType="UNIT_CAVALRY" PromotionType="PROMOTION_MOUNTED_PENALTY"/>
<Delete UnitType="UNIT_RUSSIAN_COSSACK" PromotionType="PROMOTION_MOUNTED_PENALTY"/>

</Unit_FreePromotions>

<Unit_ResourceQuantityRequirements>

<Update>
<Set ResourceType="Oil"/>
<Where UnitType="UNIT_MODERN_ARMOR"/>
</Update>

</Unit_ResourceQuantityRequirements>

<UnitPromotions>

<Row>
<Set LostWithUpgrade="true"/>
<Where Type="PROMOTION_ANTI_MOUNTED_I"/>
</Row>
<Row>
<Set LostWithUpgrade="true"/>
<Where Type="PROMOTION_ANTI_MOUNTED_II"/>
</Row>

</UnitPromotions>

<UnitPromotions_UnitCombatMods>

<Update>
<Set Modifier="50"/>
<Where PromotionType="PROMOTION_ANTI_MOUNTED_I"/>
</Update>
<Update>
<Set Modifier="75"/>
<Where PromotionType="PROMOTION_ANTI_MOUNTED_II"/>
</Update>

</UnitPromotions_UnitCombatMods>

</GameData>
 
The problem I immediately noticed is
Code:
<Row>
<Set PromotionType="PROMOTION_CITY_PENALTY"/>
<Where UnitType="UNIT_MODERN_ARMOR"/>
</Row>

That's not the right syntax. If you're making a NEW row, then you need to type it just like the existing Row entries:
Code:
<Row>
  <UnitType>UNIT_MODERN_ARMOR</UnitType>
  <PromotionType>PROMOTION_CITY_PENALTY</PromotionType>
</Row>

You only use the Set/Where syntax for Update commands.

There might be more, but I'll have to look through it later.
 
Any luck with that Terrain folder?

Just take your current Terrain folder. Rename it something else. Then go into Steam and tell it to verify the game's files; it should see the files are missing and replace them with the correct versions.
 
Well, I think I've finished the mod. I tested it for a while and everything seems to be loading, miracle of miracles. Turns out you were right about it not being that difficult once you get the hang of it. I wouldn't have done it without your encouragement. Thanks once more.
 
One last question- If you are adding an element (think that's the right term) to a Row, do you use the Set/Where commands? For example, I want the Pikeman's bonus versus mounted to disappear when it upgrades to a Musketman. Is this code correct?

<Update>
<Set LostWithUpgrade="true"/>
<Where Type="PROMOTION_ANTI_MOUNTED_II"/>
</Update>
 
Is this code correct?

Yes. That'd work just fine.

Note that you're not ADDING an element to a Row. You're simply updating the existing element. In the table at the top of the file, most entries have a "Default="false" " sort of entry. Tables work this way; if there are 20 schema defined in the Table definition at the top of the file, then internally the game will store 20 values for every Row. It's just that any you don't set in XML will use whatever default value was defined at the top, so every promotion is being set to LostWithUpgrade="false" unless you say otherwise. Anything without a Default value MUST be set for the entry to work.

This is the big difference between the "primary" tables (the big ones with ID numbers) and the smaller "secondary" tables; the smaller tables rarely use defaults.

(And minor nitpick: the Pikeman upgrades to the Rifleman, not the Musketman. It skips that step.)
 
Back
Top Bottom