Any idea why this spell has problem?

It simply don't appear in the list of spells to cast, even if my sovereign has the prerequisites:

 

<AutoUnlock>1</AutoUnlock>
<SpellBookSortCategory>Unit</SpellBookSortCategory>
<SpellBookSortSubCategory>UnitEnchantment</SpellBookSortSubCategory>
<SpellType>Strategic</SpellType>
<SpellClass>Defensive</SpellClass>
<SpellSubClass>Buff</SpellSubClass>
<SpellTargetType>FriendlyUnit</SpellTargetType>
<Prereq>
<Type>AbilityBonusOption</Type>
<Attribute>Air2</Attribute>
</Prereq>
<Prereq>
<Type>AbilityBonusOption</Type>
<Attribute>Earth2</Attribute>
</Prereq>
<SpellResourceCost>
<Resource>Mana</Resource>
<Amount>13</Amount>
</SpellResourceCost>
<SpellResourceCost>
<Resource>Mana</Resource>
<Amount>1</Amount>
<PerTurn>1</PerTurn>
</SpellResourceCost>
<GameModifier>
<ModType>Unit</ModType>
<Attribute>MovementCostOverRide</Attribute>
<StrVal>SwampTerrain</StrVal>
<Value>10</Value>
<PerTurn>1</PerTurn>
<Provides>No movement penalty in Swamps</Provides>
</GameModifier>
<GameModifier>
<ModType>Unit</ModType>
<Attribute>MovementCostOverRide</Attribute>
<StrVal>Forest</StrVal>
<Value>10</Value>
<PerTurn>1</PerTurn>
<Provides>No movement penalty in Forests</Provides>
</GameModifier>
<GameModifier>
<ModType>Unit</ModType>
<Attribute>MovementCostOverRide</Attribute>
<StrVal>HillsTerrain</StrVal>
<Value>10</Value>
<PerTurn>1</PerTurn>
<Provides>No movement penalty in Hills</Provides>
</GameModifier>
<AIData AIPersonality="AI_General">
<AIPriority>5</AIPriority>
</AIData>
<SpellDefEffect>
<EffectName>S_Courage_Particle</EffectName>
<LocalPosition>0,0,0</LocalPosition>
<EffectScale>1</EffectScale>
<SnapToTerrain>1</SnapToTerrain>
</SpellDefEffect>
</SpellDef>

3,661 views 2 replies
Reply #1 Top

Is this a partial cut and paste of your spell or the whole thing?

 

As an example, let's look at the "Aid" spell (first spell) in CoreSpells.xml

 

<SpellDef InternalName="Aid">
  <DisplayName>Aid</DisplayName>
  <Description>Heals target unit by 4 (+2 per life shard).</Description>
  <FormattedDescription>Heals target unit by %d.</FormattedDescription>
  <Image>T_Heal_Painting.png</Image>
  <IconFG>T_Aid_Icon.png</IconFG>
  <IconColor>174,255,59</IconColor>
  <AutoUnlock>0</AutoUnlock>
  <SpellBookSortCategory>Unit</SpellBookSortCategory>
  <SpellBookSortSubCategory>Heal</SpellBookSortSubCategory>
  <SpellType>Tactical</SpellType>
  <SpellClass>Defensive</SpellClass>
  <SpellSubClass>Heal</SpellSubClass>
  <SpellTargetType>FriendlyUnit</SpellTargetType>
  <SpellResourceCost>
    <Resource>Mana</Resource>
    <Amount>8</Amount>
  </SpellResourceCost>
  <GameModifier>
    <ModType>Unit</ModType>
    <Attribute>CurHealth</Attribute>
    <IsForFormattedDescription>1</IsForFormattedDescription>
    <Calculate InternalName="Calc" ValueOwner="CastingUnit">
      <Expression><![CDATA[[UnitOwner_GetNumLifeShards] * 2]]></Expression>
    </Calculate>
    <Calculate InternalName="Value">
      <Expression><![CDATA[[Calc] + 4]]></Expression>
    </Calculate>
    <Calculate InternalName="ValueForFormattedDescription">
      <Expression><![CDATA[[Calc] + 4]]></Expression>
    </Calculate>
  </GameModifier>
  <AIData AIPersonality="AI_General">
    <AIPriority>15</AIPriority>
  <ValueCalcWrapper>
    <ValueType>IsTargetWorthy</ValueType>
    <Calculate InternalName="Calc" ValueOwner="TargetUnit">
      <Expression><![CDATA[[Unit_GetHPCurrent]]]></Expression>
    </Calculate>
    <Calculate InternalName="Value">
      <Expression><![CDATA[[Calc] < 30]]></Expression>
    </Calculate>
  </ValueCalcWrapper>
  </AIData>
  <HitSoundFX>Spell_Heal_01</HitSoundFX>
  <HitSoundFX>Spell_Heal_02</HitSoundFX>
  <SpellDefEffect>
    <EffectName>T_Heal_Particle</EffectName>
    <LocalPosition>0,0,0</LocalPosition>
    <EffectScale>.75</EffectScale>
    <EffectDelay>0</EffectDelay>
    <SnapToTerrain>1</SnapToTerrain>
  </SpellDefEffect>
</SpellDef>

 

Note that it has an InternalName, a DisplayName, Icon designation, etc. 

Also, (and I'm sure this is a cut and paste issue) be sure the formatting of indentation is correct and lines up and every open has a close.

Reply #2 Top

Yeah you're missing all sorts of important stuff at the beginning of the spell.  I also have no idea if MovementCostOverRide is a valid attribute for spells, and I don't think <Provides> tags work for spells either.