Eat salt pork while defending. Brilliant, Heavenfall fixed it.

By all appearances, this should be working. The hp heal as normal, the particle effect fires off, but there is something missing that makes the defensive bonus not show up. When you defend in combat the bonus appears as a unit enchantment - this is not showing up. I thught perhaps the reason why is the spell thinks the casting unit is the "salted pork" but that doesn't make sense since the particle effect fires off. Perhaps there is some hidden combat code that applies the enchantment effect.

 

<GameItemType InternalName="SaltedPork">

         <DisplayName>Salted Pork</DisplayName>

         <Description>A rare type of salted pork that works wonders for a weary soul.  Eat it to heal 20 points of damage while defending.</Description>

         <ShopValue>30</ShopValue>

               <Image>Ability_Defend_Icon.png</Image>

         <IconFG>Ability_Defend_Icon.png</IconFG>

         <SpellType>Tactical</SpellType>

         <SpellClass>Defensive</SpellClass>

         <SpellSubClass>Buff</SpellSubClass>

         <SpellTargetType>Self</SpellTargetType>

           <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>CurHealth</Attribute>

             <Value>20</Value>

             <Provides>Heals 20 Hit Points</Provides>

         </GameModifier>

          <GameModifier>

                   <ModType>Unit</ModType>

             <Attribute>AdjustUnitStat</Attribute>

             <StrVal>UnitStat_Defense_Blunt</StrVal>

             <Duration>1</Duration>

             <UpdateDurationAtTurnStart>1</UpdateDurationAtTurnStart>

             <Effect>Y_Defend_Particle</Effect>

             <Calculate InternalName="Calc" ValueOwner="CastingUnit">

                 <Expression><![CDATA[[UnitStat_Tactical_Auto_Defense_Boost]]]></Expression>

             </Calculate>

             <Calculate InternalName="Value">

                 <Expression><![CDATA[[Calc]]]></Expression>

             </Calculate>

         </GameModifier>

         <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>AdjustUnitStat</Attribute>

             <StrVal>UnitStat_Defense_Cutting</StrVal>

             <Duration>1</Duration>

             <UpdateDurationAtTurnStart>1</UpdateDurationAtTurnStart>

             <Calculate InternalName="Calc" ValueOwner="CastingUnit">

                 <Expression><![CDATA[[UnitStat_Tactical_Auto_Defense_Boost]]]></Expression>

             </Calculate>

             <Calculate InternalName="Value">

                 <Expression><![CDATA[[Calc]]]></Expression>

             </Calculate>

         </GameModifier>

         <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>AdjustUnitStat</Attribute>

             <StrVal>UnitStat_Defense_Pierce</StrVal>

             <Duration>1</Duration>

             <UpdateDurationAtTurnStart>1</UpdateDurationAtTurnStart>

             <Calculate InternalName="Calc" ValueOwner="CastingUnit">

                 <Expression><![CDATA[[UnitStat_Tactical_Auto_Defense_Boost]]]></Expression>

             </Calculate>

             <Calculate InternalName="Value">

                 <Expression><![CDATA[[Calc]]]></Expression>

             </Calculate>

         </GameModifier>

         <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>

         <RarityDisplay>Common</RarityDisplay>

         <IsUsable>1</IsUsable>

         <UsableInBattle>1</UsableInBattle>

         <ArtDef>SaltedPork_ArtDef</ArtDef>

         <GameItemTypeArtDef InternalName="SaltedPork_ArtDef">

             <GameItemTypeModelPack InternalName="SaltedPork_Default">

                 <IconFile>SaltedPork_Item.png</IconFile>

                 <MapParticle>T_Heal_Particle</MapParticle>

                 <TintR>79</TintR>

                 <TintG>48</TintG>

                 <TintB>20</TintB>

                 <SFX>Eating</SFX>

                 <GameItemTypeModel>

                 </GameItemTypeModel>

             </GameItemTypeModelPack>

         </GameItemTypeArtDef>

     </GameItemType>

5,241 views 6 replies
Reply #1 Top

This is the same thing I encountered when attempting to "burn" targets over time with fire bows/staves.  I can get the particle effects to kick off for the duration, but not apply any damage.

I don't think it can be done without workarounds (if it can be done at all).

Hey, Frogboy, it would be really sweet if we could get spell/ability triggers within spells/abilities.

Reply #2 Top

Increase the duration to 2. It is being applied, then the unit's turn ends, making it expire instantly.

Reply #3 Top


headscratching... will try it, but that makes no sense...

Reply #4 Top


Ok it didn't work when i increased the duration. I will continue to try to make it work, but my impression is that the autodefense bonus is being applied by a hidden feature within the combat mechanics.

Reply #5 Top

Sorry, I'm an idiot. The problem of course is that you aren't using a spell.

<?xml version="1.0"?>
<container>
  <GameItemType InternalName="SaltedPork">
    <DisplayName>Salted Pork</DisplayName>
    <Description>A rare type of salted pork that works wonders for a weary soul.  Eat it to heal 20 points of damage while defending.</Description>
    <ShopValue>30</ShopValue>
    <Image>Ability_Defend_Icon.png</Image>
    <IconFG>Ability_Defend_Icon.png</IconFG>
    <GameModifier>
      <ModType>Unit</ModType>
      <Attribute>CurHealth</Attribute>
      <Value>20</Value>
      <Provides>Heals 20 Hit Points</Provides>
    </GameModifier>
    <GameModifier>
      <ModType>Unit</ModType>
      <Attribute>UseSpell</Attribute>
      <StrVal>AutoDefend2</StrVal>
      <Provides>Unit Defends until start of its next turn</Provides>
    </GameModifier>
    <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>
    <RarityDisplay>Common</RarityDisplay>
    <IsUsable>1</IsUsable>
    <UsableInBattle>1</UsableInBattle>
    <ArtDef>SaltedPork_ArtDef</ArtDef>
  </GameItemType>
  <SpellDef InternalName="AutoDefend2">
    <DisplayName>Defending</DisplayName>
    <Description>When a unit passes their attack action, their Defense is improved until their next action.</Description>
    <Image>Ability_Defend_Icon.png</Image>
    <IconFG>Ability_Defend_Icon.png</IconFG>
    <IconColor>32,45,243</IconColor>
    <SpellBookSortCategory>Unit</SpellBookSortCategory>
    <SpellBookSortSubCategory>UnitEnchantment</SpellBookSortSubCategory>
    <SpellType>Tactical</SpellType>
    <SpellClass>Defensive</SpellClass>
    <SpellSubClass>Buff</SpellSubClass>
    <SpellTargetType>Self</SpellTargetType>
    <HideInHiergamenon>1</HideInHiergamenon>
    <IsCastable>0</IsCastable>
    <GameModifier>
      <ModType>Unit</ModType>
      <Attribute>AdjustUnitStat</Attribute>
      <StrVal>UnitStat_Defense_Blunt</StrVal>
      <Duration>1</Duration>
      <UpdateDurationAtTurnStart>1</UpdateDurationAtTurnStart>
      <Effect>Y_Defend_Particle</Effect>
      <Calculate InternalName="Calc" ValueOwner="CastingUnit">
        <Expression><![CDATA[[UnitStat_Tactical_Auto_Defense_Boost]]]></Expression>
      </Calculate>
      <Calculate InternalName="Value">
        <Expression><![CDATA[[Calc]]]></Expression>
      </Calculate>
    </GameModifier>
    <GameModifier>
      <ModType>Unit</ModType>
      <Attribute>AdjustUnitStat</Attribute>
      <StrVal>UnitStat_Defense_Cutting</StrVal>
      <Duration>1</Duration>
      <UpdateDurationAtTurnStart>1</UpdateDurationAtTurnStart>
      <Calculate InternalName="Calc" ValueOwner="CastingUnit">
        <Expression><![CDATA[[UnitStat_Tactical_Auto_Defense_Boost]]]></Expression>
      </Calculate>
      <Calculate InternalName="Value">
        <Expression><![CDATA[[Calc]]]></Expression>
      </Calculate>
    </GameModifier>
    <GameModifier>
      <ModType>Unit</ModType>
      <Attribute>AdjustUnitStat</Attribute>
      <StrVal>UnitStat_Defense_Pierce</StrVal>
      <Duration>1</Duration>
      <UpdateDurationAtTurnStart>1</UpdateDurationAtTurnStart>
      <Calculate InternalName="Calc" ValueOwner="CastingUnit">
        <Expression><![CDATA[[UnitStat_Tactical_Auto_Defense_Boost]]]></Expression>
      </Calculate>
      <Calculate InternalName="Value">
        <Expression><![CDATA[[Calc]]]></Expression>
      </Calculate>
    </GameModifier>
  </SpellDef>
</container>
End of quote

You had a bunch of spell tags in your item so I just assumed it was a spell (didn't even look at the top of it).

Reply #6 Top

erased - oh i get it you altered the spell.

Nice. I have not delved into the xml as much as you have. I didn't think it would require an internal spell to be called. I haven't seen too many examples of that until yesterday when i found three examples.