[1.0.9t,s,r,q,p...] Incomplete XML references in CoreUnits.xml

Not all units have all their UnitStats set and so the default is being used. In particular, some units start the game with 10 Constitution (system default I guess) but new units use the defaults from Kingdom_GenericBaseUnit_Male.

Current code typically looks like this:

Code: xml
  1.         <!-- levels -->
  2.         <LevelMilestone InternalName="L1">
  3.             <Level>1</Level>
  4.             <UnitStat_HitPoints>0</UnitStat_HitPoints>
  5.             <UnitStat_Defense>0</UnitStat_Defense>
  6.             <UnitStat_CombatSpeed>2</UnitStat_CombatSpeed>
  7.             <UnitStat_Sight>3</UnitStat_Sight>
  8.             <Intelligence>0</Intelligence>
  9.             <UnitStat_Charisma>0</UnitStat_Charisma>
  10.             <UnitStat_Essence>0</UnitStat_Essence>
  11.             <UnitStat_Experience>5</UnitStat_Experience>
  12.             <UnitStat_ExpToNextLevel>20</UnitStat_ExpToNextLevel>
  13.         </LevelMilestone>
  14.         <LevelMilestone InternalName="L10">
  15.             <Level>10</Level>
  16.             <UnitStat_HitPoints>36</UnitStat_HitPoints>
  17.             <UnitStat_Attack>2</UnitStat_Attack>
  18.             <UnitStat_Defense>0</UnitStat_Defense>
  19.             <UnitStat_CombatSpeed>10</UnitStat_CombatSpeed>
  20.             <UnitStat_Sight>4</UnitStat_Sight>
  21.             <Intelligence>0</Intelligence>
  22.             <UnitStat_Charisma>0</UnitStat_Charisma>
  23.             <UnitStat_Essence>0</UnitStat_Essence>
  24.             <UnitStat_Experience>15</UnitStat_Experience>
  25.             <UnitStat_ExpToNextLevel>300</UnitStat_ExpToNextLevel>
  26.         </LevelMilestone>

Should have the line '<UnitStat_Constitution>5</UnitStat_Constitution>' added:

Code: xml
  1.         &lt;!-- levels --&gt;
  2.         &lt;LevelMilestone InternalName="L1"&gt;
  3.             &lt;Level&gt;1&lt;/Level&gt;
  4.             &lt;UnitStat_HitPoints&gt;0&lt;/UnitStat_HitPoints&gt;
  5.             &lt;UnitStat_Defense&gt;0&lt;/UnitStat_Defense&gt;
  6.             &lt;UnitStat_CombatSpeed&gt;2&lt;/UnitStat_CombatSpeed&gt;
  7.             &lt;UnitStat_Sight&gt;3&lt;/UnitStat_Sight&gt;
  8.             &lt;Intelligence&gt;0&lt;/Intelligence&gt;
  9.             &lt;UnitStat_Charisma&gt;0&lt;/UnitStat_Charisma&gt;
  10.             &lt;UnitStat_Constitution&gt;5&lt;/UnitStat_Constitution&gt;
  11.             &lt;UnitStat_Essence&gt;0&lt;/UnitStat_Essence&gt;
  12.             &lt;UnitStat_Experience&gt;5&lt;/UnitStat_Experience&gt;
  13.             &lt;UnitStat_ExpToNextLevel&gt;20&lt;/UnitStat_ExpToNextLevel&gt;
  14.         &lt;/LevelMilestone&gt;
  15.         &lt;LevelMilestone InternalName="L10"&gt;
  16.             &lt;Level&gt;10&lt;/Level&gt;
  17.             &lt;UnitStat_HitPoints&gt;36&lt;/UnitStat_HitPoints&gt;
  18.             &lt;UnitStat_Attack&gt;2&lt;/UnitStat_Attack&gt;
  19.             &lt;UnitStat_Defense&gt;0&lt;/UnitStat_Defense&gt;
  20.             &lt;UnitStat_CombatSpeed&gt;10&lt;/UnitStat_CombatSpeed&gt;
  21.             &lt;UnitStat_Sight&gt;4&lt;/UnitStat_Sight&gt;
  22.             &lt;Intelligence&gt;0&lt;/Intelligence&gt;
  23.             &lt;UnitStat_Charisma&gt;0&lt;/UnitStat_Charisma&gt;
  24.             &lt;UnitStat_Constitution&gt;5&lt;/UnitStat_Constitution&gt;
  25.             &lt;UnitStat_Essence&gt;0&lt;/UnitStat_Essence&gt;
  26.             &lt;UnitStat_Experience&gt;15&lt;/UnitStat_Experience&gt;
  27.             &lt;UnitStat_ExpToNextLevel&gt;300&lt;/UnitStat_ExpToNextLevel&gt;
  28.         &lt;/LevelMilestone&gt;

This affects:

Sovereign_MaleSpouse
Sovereign_FemaleSpouse
Kingdom_Soldier
Kingdom_Pioneer
Ironeer
Fallen_Ambassador
Empire_GenericBaseUnit_Female
Fallen_Pioneer

 

@Stardock: BTW, I'm not sure if this is helpful to your process or not because I've been providing feedback on this now for quite a few beta versions but it hasn't made the todo list or the changelog - yet it clearly is a bug. Please let me know if I should just drop reporting this in future because it feels strange repeating the same information over and over.

2,207 views 8 replies
Reply #1 Top

As far as I know - and I could be wrong here - the LevelMileStone containers and associated tags aren't used in any way at all in-game.

Reply #2 Top

CoreUnits.xml has been dramatically cleaned and tweaked in 1.0.9u with essence removed and numbers changed. It appears that all except the Kingdom Pioneers have been fixed.

I just did a quick mod test and LevelMileStone is indeed working. :) If it wasn't before then I'd strongly suggest that modders now look at the new clean code Stardock have placed within this file. Looking much more stremlined. :)

Reply #3 Top

In what sense is it working? I can't get any stat to change according to the milestones.

Reply #4 Top

I made a mod that just contained the Kingdom_Pioneer. Then I changed a few setting such as the default image. And I also added the constitution command setting it really high. Everything changed as desired in-game.

Once it was working I deleted the mod file otherwise I'd post it.

Reply #5 Top

       <LevelMilestone InternalName="L1">
            <Level>1</Level>
            <UnitStat_HitPoints>5</UnitStat_HitPoints>
            <UnitStat_Attack>6</UnitStat_Attack>
            <UnitStat_Defense>3</UnitStat_Defense>
            <UnitStat_CombatSpeed>3</UnitStat_CombatSpeed>
            <UnitStat_Strength>10</UnitStat_Strength>
            <UnitStat_Wisdom>1</UnitStat_Wisdom>
            <UnitStat_Dexterity>4</UnitStat_Dexterity>
            <UnitStat_Intelligence>1</UnitStat_Intelligence>
            <UnitStat_Charisma>1</UnitStat_Charisma>
            <UnitStat_Constitution>14</UnitStat_Constitution>
            <UnitStat_Sight>2</UnitStat_Sight>
        <UnitStat_Moves>3.0000</UnitStat_Moves>
        </LevelMilestone>
 
        <LevelMilestone InternalName="L10">
            <Level>10</Level>
            <UnitStat_HitPoints>5</UnitStat_HitPoints>
            <UnitStat_Attack>30</UnitStat_Attack>
            <UnitStat_Defense>16</UnitStat_Defense>
            <UnitStat_CombatSpeed>3</UnitStat_CombatSpeed>
            <UnitStat_Strength>16</UnitStat_Strength>
            <UnitStat_Wisdom>1</UnitStat_Wisdom>
            <UnitStat_Dexterity>26</UnitStat_Dexterity>
            <UnitStat_Intelligence>10</UnitStat_Intelligence>
            <UnitStat_Charisma>1</UnitStat_Charisma>
            <UnitStat_Constitution>2600</UnitStat_Constitution>
            <UnitStat_Sight>2</UnitStat_Sight>
        <UnitStat_Moves>3.0000</UnitStat_Moves>
        </LevelMilestone>
End of quote

Result on level-up: No stat difference.

Reply #6 Top

15:46 <Heavenfall> Quick question if you have a minute; does the <LevelMilestone> container and associated tags actually work?
16:17 <Cari_Elf> I asked boogiebac and he thinks that it's only used when spawning a unit at a specific level
16:17 <Cari_Elf> as opposed to being used to auto-level units

Reply #7 Top

Oh hang on. I think we are at cross-purposes here. :)

I haven't experimented with levelling up using milestones. All I was pointing out was that the base stats for certain troops were inconsistent and that by upgrading these units you could milk a few extra hit points.

I just tried an experiement...

Uber Peon Mod File

where the default Kingdom peasant is replaced by an Uber Peon.

Code: xml
  1. &lt;?xml version="1.0" encoding="utf-8"?&gt;
  2. &lt;UnitTypes&gt;
  3.     &lt;!-- ********************** --&gt;
  4.     &lt;!-- ** Kingdom_Peasant ** --&gt;
  5.     &lt;!-- ********************** --&gt;
  6.     &lt;UnitType InternalName="Kingdom_Soldier"&gt;
  7.         &lt;!-- base data--&gt;
  8.         &lt;DisplayName&gt;Uber Peon&lt;/DisplayName&gt;
  9.         &lt;Description&gt;A peasant armed with a crude cudgel.&lt;/Description&gt;
  10.         &lt;CanBeDesigned&gt;1&lt;/CanBeDesigned&gt;
  11.     &lt;IsStartingUnitType&gt;1&lt;/IsStartingUnitType&gt;
  12.         &lt;!-- graphical data--&gt;
  13.         &lt;ModelPath&gt;Gfx\HKB\Units\K_Male_Mesh_01.hkb&lt;/ModelPath&gt;
  14.         &lt;SkeletonPath&gt;Gfx\HKB\Units\K_Male_Skeleton_01.hkb&lt;/SkeletonPath&gt;
  15.         &lt;EyeTexture&gt;gfx\Eyes\blinks\eyeblink_m1_brwn.png&lt;/EyeTexture&gt;
  16.         &lt;Texture_Skin&gt;K_Male_Default_Texture_01.png&lt;/Texture_Skin&gt;
  17.         &lt;AnimationPack&gt;SoldierAnimationPack&lt;/AnimationPack&gt;
  18.         &lt;ClothPoseIndex&gt;1&lt;/ClothPoseIndex&gt;
  19.         &lt;InfoCardBackground&gt;BG_GoodScene&lt;/InfoCardBackground&gt;
  20.         &lt;UnitModelType&gt;KingdomMale&lt;/UnitModelType&gt;
  21.         &lt;!-- Sovereign Equipment Data --&gt;
  22.         &lt;Equipment&gt;Sovereign_Warrior_Hair&lt;/Equipment&gt;
  23.         &lt;Equipment&gt;Sovereign_Warrior_Shirt_Crappy_ID1&lt;/Equipment&gt;
  24.         &lt;Equipment&gt;GnarledClub&lt;/Equipment&gt;
  25.         &lt;Equipment&gt;K_Male_Head_01&lt;/Equipment&gt;
  26.         &lt;!-- soundFX --&gt;
  27.         &lt;MovingSFX&gt;TEMP_KnightMarching1&lt;/MovingSFX&gt;
  28.         &lt;Medallions InternalName=""&gt;
  29.             &lt;All&gt;Peasant.png&lt;/All&gt;
  30.         &lt;/Medallions&gt;
  31.     &lt;ProductionRequirement&gt;
  32.       &lt;Type&gt;Resource&lt;/Type&gt;
  33.       &lt;Attribute&gt;AvailableSpecialists&lt;/Attribute&gt;
  34.       &lt;Value&gt;1.0&lt;/Value&gt;
  35.     &lt;/ProductionRequirement&gt;
  36.         &lt;!-- levels --&gt;
  37.         &lt;LevelMilestone InternalName="L1"&gt;
  38.             &lt;Level&gt;1&lt;/Level&gt;
  39.             &lt;UnitStat_HitPoints&gt;0&lt;/UnitStat_HitPoints&gt;
  40.             &lt;UnitStat_Defense&gt;0&lt;/UnitStat_Defense&gt;
  41.             &lt;UnitStat_CombatSpeed&gt;2&lt;/UnitStat_CombatSpeed&gt;
  42.             &lt;UnitStat_Sight&gt;3&lt;/UnitStat_Sight&gt;
  43.             &lt;Intelligence&gt;0&lt;/Intelligence&gt;
  44.             &lt;UnitStat_Charisma&gt;0&lt;/UnitStat_Charisma&gt;
  45.             &lt;UnitStat_Constitution&gt;5&lt;/UnitStat_Constitution&gt;
  46.             &lt;UnitStat_Essence&gt;0&lt;/UnitStat_Essence&gt;
  47.             &lt;UnitStat_Experience&gt;5&lt;/UnitStat_Experience&gt;
  48.             &lt;UnitStat_ExpToNextLevel&gt;20&lt;/UnitStat_ExpToNextLevel&gt;
  49.         &lt;/LevelMilestone&gt;
  50.         &lt;LevelMilestone InternalName="L2"&gt;
  51.             &lt;Level&gt;2&lt;/Level&gt;
  52.             &lt;UnitStat_HitPoints&gt;0&lt;/UnitStat_HitPoints&gt;
  53.             &lt;UnitStat_Attack&gt;10&lt;/UnitStat_Attack&gt;
  54.             &lt;UnitStat_Defense&gt;0&lt;/UnitStat_Defense&gt;
  55.             &lt;UnitStat_CombatSpeed&gt;2&lt;/UnitStat_CombatSpeed&gt;
  56.             &lt;UnitStat_Sight&gt;3&lt;/UnitStat_Sight&gt;
  57.             &lt;Intelligence&gt;0&lt;/Intelligence&gt;
  58.             &lt;UnitStat_Charisma&gt;0&lt;/UnitStat_Charisma&gt;
  59.             &lt;UnitStat_Constitution&gt;1500&lt;/UnitStat_Constitution&gt;
  60.             &lt;UnitStat_Experience&gt;15&lt;/UnitStat_Experience&gt;
  61.             &lt;UnitStat_ExpToNextLevel&gt;300&lt;/UnitStat_ExpToNextLevel&gt;
  62.         &lt;/LevelMilestone&gt;
  63.     &lt;/UnitType&gt;
  64. &lt;/UnitTypes&gt;

The unit should have had a massive HP boost once it reaches level 2 along with other changes but you're right, none of the LevelMilestone changes are working.

-------------------------------- EDIT ------------------------------

Just saw your new info. That would explain it. :)

Reply #8 Top

There are some bonuses when you level up that are free, like extra hitpoints and accuracy. But they are not determined by the milestones.