Summoning champion using a custom model...

Alright, I've been trying to create a spell that summons a champion using the tag:

  <SpellDef InternalName="SummonCelestial">
    <DisplayName>Celestial Contract</DisplayName>
    <Description>Summons a celestial champion to aid in your cause</Description>
    <Image>Escape_Painting.png</Image>
    <IconFG>SpellBlast_Icon.png</IconFG>
    <IconBG>SpellBlast_Icon_BG.png</IconBG>
    <IconColor>64,59,255</IconColor>
    <SoundFX>DarklingIdleGiggle3</SoundFX>
    <Range>1</Range>
    <SpellLevel>1</SpellLevel>
    <RequiredStat>UnitStat_Charisma, 14</RequiredStat>
    <SpellType>Strategic</SpellType>
    <SpellClass>Defensive</SpellClass>
    <SpellTargetType>Self</SpellTargetType>

    <CastTime>1</CastTime>
    <SpellResourceCost>
      <Resource>Mana</Resource>
      <Amount>48</Amount>
    </SpellResourceCost>
    <SpellResourceCost>
      <Resource>Mana</Resource>
      <Amount>1</Amount>
      <PerTurn>1</PerTurn>
    </SpellResourceCost>

    <SpellDefEffect>
      <EffectName>SummonLife</EffectName>
      <LocalPosition>0,0,0</LocalPosition>
      <EffectScale>0.4</EffectScale>
      <EffectDelay>0.0</EffectDelay>
      <SnapToTerrain>1</SnapToTerrain>
    </SpellDefEffect>
    <GameModifier InternalName="SummonUnit">
      <ModType>Unit</ModType>
      <Attribute>UnitJoinArmy</Attribute>
      <StrVal>CelestialChampion</StrVal>
      <UnitClass>Champion</UnitClass>
      <Duration>-1</Duration>
    </GameModifier>
  </SpellDef>

which references the code (adapted from the EFM generously created and given permission for use by Heavenfall):

<UnitType InternalName="CelestialChampion">
  <DisplayName>Celestial</DisplayName>
  <UnitDisplayName>Celestial</UnitDisplayName>
  <Quote>"Sometimes lost is exactly where you need to be."</Quote>
  <ModelPath>Gfx\HKB\Units\K_Male_Mesh_01.hkb</ModelPath>
  <SkeletonPath>Gfx\HKB\Units\K_Male_Skeleton_01.hkb</SkeletonPath>
  <EyeTexture>gfx\eyes\blinks\eyeblink_m4_grn.png</EyeTexture>
  <AnimationPack>SoldierAnimationPack</AnimationPack>
  <MountedAnimationPack>MountedSoldierAnimationPack</MountedAnimationPack>
  <ModelScale>1.0000</ModelScale>
  <EquipmentScale>1.0000</EquipmentScale>
  <ClothMapScale>1.2000</ClothMapScale>
  <MovementType>Air</MovementType>
  <BobbingFrequency>0.0000</BobbingFrequency>
  <ClothPoseIndex>1</ClothPoseIndex>
  <InfoCardBackground>BG2_Abstract</InfoCardBackground>
  <InfoCardBackgroundFlipped>0</InfoCardBackgroundFlipped>
  <CanBeDesigned>0</CanBeDesigned>
  <UserDesigned>true</UserDesigned>
  <MovingSFX>TEMP_KnightMarching1</MovingSFX>
  <LevelMilestone InternalName="">
   <Level>1</Level>
   <UnitStat_Attack>0.0000</UnitStat_Attack>
   <UnitStat_Charisma>16.0000</UnitStat_Charisma>
   <UnitStat_Constitution>15.0000</UnitStat_Constitution>
   <UnitStat_Defense>0.0000</UnitStat_Defense>
   <UnitStat_Dexterity>17.0000</UnitStat_Dexterity>
   <UnitStat_ExpToNextLevel>20.0000</UnitStat_ExpToNextLevel>
   <UnitStat_HitPoints>0.0000</UnitStat_HitPoints>
   <UnitStat_Intelligence>13.0000</UnitStat_Intelligence>
   <UnitStat_ManaRegen>1.0000</UnitStat_ManaRegen>
   <UnitStat_Sight>4.0000</UnitStat_Sight>
   <UnitStat_Strength>12.0000</UnitStat_Strength>
   <UnitStat_Wisdom>17.0000</UnitStat_Wisdom>
   <UnitStat_Essence>1.0000</UnitStat_Wisdom>
   <UnitStat_CombatSpeed>2</UnitStat_CombatSpeed>
  </LevelMilestone>
                          <Equipment>expandedfactions_angels_K_Male_Head_01</Equipment>
  <Equipment>CPELF_Sovereign_Short_Hair_02</Equipment>
  <Equipment>CPELF_Sovereign_Warrior_Shirt_ID1</Equipment>
  <Equipment>CPELF_Warrior_Surcoat_ID2</Equipment>
  <Equipment>CPELF_Kingdom_Leather_Gloves_Dark</Equipment>
  <Equipment>CPELF_Basic_Pants</Equipment>
  <Equipment>CPELF_Basic_Boots_Leather</Equipment>
  <Equipment>Staff</Equipment>
  <!--<Color_Skin>217,153,97,255</Color_Skin>
  <Color_Hair>176,122,74,255</Color_Hair>
  <Color_Clothing1>0,0,0,255</Color_Clothing1>
  <Color_Clothing2>50,50,50,255</Color_Clothing2>-->
  <Texture_Skin>K_Male_Default_Texture_01.png</Texture_Skin>
  <Texture_Eyes>gfx\eyes\blinks\eyeblink_m4_grn.png</Texture_Eyes>
  <Gender>Male</Gender>
  <UnitModelType>AngelMale</UnitModelType>
  
  <IsSovereign>0</IsSovereign>
  <UnitDisplayName>Celestial</UnitDisplayName>
  <NPCTalentValue>2</NPCTalentValue>
  <SpawnRating>-1</SpawnRating>
  <NPCSpawnLikelihood>-1</NPCSpawnLikelihood>
  
 </UnitType>
</UnitTypes>

And this seems to cause strange things to happen in-game. Such as asking me to update to v1.1 (which I have) and causing Fertile Land tiles to be underwater. I have the Expanded Factions mod in my mods directory.

4,140 views 7 replies
Reply #1 Top

Just want to add a quick "DO NOT TRY THIS AT HOME" disclaimer. After messing around with this a little bit, Elemental won't load, even after removing all these files from the mod directory, rebooting, and recompiling the xml. Crashes to desktop when loading the game.

It remains to be seen if a complete reinstall fixes the problem.

Reply #2 Top

After some messing around, it seems like the <UnitClass> tag can't be Champion. The only way I've gotten it to work is to use the InternalName (so it's the same as what you put in StrVal).

 

Reply #3 Top

Thanks. Yeah, you may be right.

After removing all of these files, it appears that my new, constant crashes to desktop are related to version 1.11, not messing around with these particular xmls per se.

Reply #4 Top

Reply #5 Top

Just to point it out...

<UnitStat_Wisdom>17.0000</UnitStat_Wisdom>
<UnitStat_Essence>1.0000</UnitStat_Wisdom>

Wisdom is also no longer a stat. At all, it does not even have a UnitStat definition in CoreUnitStats.xml anymore.

While I haven't tested it out in v1.11 yet, summoned (and trained, for that matter) units with Essence can't cast spells properly. They can cast Strategic spells, but not Tactical. Also, any unit that is summoned will not be considered a Champion at all. No exploring notable locations/quest huts, no level up picks, no changing equipment, nothing.

The same applies if you summon a Champion that is always spawned with other Champions in tow (like Joffrey), none of them will be Champions proper. Even more weird, a summoned Champion will always have the name "Champion", but Champions brought along with that one have their proper names!

*sigh*

Reply #6 Top

Hand: Ah, yeah good call on that tag. I do believe that other unit files have kept the Wisdom thing as extra baggage.

Sadly (for me), my problems loading mods have continued even after removing these files completely.

Reply #7 Top

Er, one thing I know is that in the past people have made champion files by basing them on custom sovereign files. Is that how you came up with that unit? If not, it might be worth taking a look at a custom champion file to compair and such.