Modding 'Tireless March' unit enchantment.

By on June 21, 2014 6:13:43 PM from Elemental Forums Elemental Forums

Peter Cohen

Join Date 02/2003
0

I would like to mod the unit enchantment 'Tireless March' so that it is not limited to a single casting, a single unit possessing the enchantment. I've looked at the coding and cannot for the life of me figure out what I need to edit. Can anyone point me in the right direction?

Locked Post 3 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
June 21, 2014 6:33:24 PM from Elemental Forums Elemental Forums

OK, looking over the code real quick, I see two possibilities...

One, the Can Stack tag is set to 0, although I think that is to prevent you from casting it on the same stack 5 times...

Secondly, this tag seems out of place...


        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>UnlockSpell</Attribute>
            <StrVal>TirelessMarch</StrVal>
            <Duration>-1</Duration>
        </GameModifier>

I'm guessing that this is the tag that is 'locking out' the spell.  Note that it unlocks the same spell that you are casting (refers to the same spell internal name tag) Have you tried commenting it out yet?

 

Finally, if the above doesn't work, I'd suggest creating an entirely new spell, with just this modifier tag


        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustArmyStat</Attribute>
            <StrVal>UnitStat_Moves</StrVal>
            <Duration>-1</Duration>
            <Value>1</Value>
        </GameModifier>

Use another strategic spell that you KNOW can be cast on multiple units/stacks at once as your template, and simply delete the 'unrelated' gamemodifiers from that spell and add this one.

 

DO keep in mind that if you remove the 'cast once only' limitation, there is nothing to stop you from casting this spell on say five different Champions in the same stack, hence possibly adding a total of 5 to your army move... In my experience, having a playtesting Sov which has the AdjustArmyStat (+1 Move) tag, the Tireless March spell will 'stack' on top of that modifier.

What might be more interesting is to create a 'Mass Tireless March' spell, which has mod type Player instead of Unit.  If I'm guessing correctly, that would add +1 move to ALL of a player's armies.  Hence, it should cost a bit more to cast...

It would also stack with Tireless March, so one of those stacks would have a +2 move if both spells are in play...

 

Edit:  Aha, this tag is new to me...


        <UniqueSpellUnlock>TirelessMarch</UniqueSpellUnlock>

Interestingly, this is the only Spell that doesn't have

        <CasterMustBeSov>1</CasterMustBeSov>

accompanying the <UniqueSpellUnlock> tag.  So all other 'unique' spells are Sov cast only...

This is the first time I've noticed this tag (doing a Core Spells check, only a couple of other spells have it).  Try commenting it out, plus commenting out the 'unlock' tag above ( <!--  --> ) and see what happens...

Reason for Karma (Optional)
Successfully updated karma reason!
June 22, 2014 1:08:56 PM from Elemental Forums Elemental Forums

Thank you very much for your assistance Tjashen. I would have been lost without you.

I did as you suggested and sadly it did not work. It resulted in an odd situation of appearing to cost maintenance twice. Moreover it was still restricted to a single casting. The code I used was:

<?xml version="1.0"?>

<panpiper>

</SpellDef>
<SpellDef InternalName="TirelessMarch">
<DisplayName>Tireless March</DisplayName>
<Description>Increases the movement of the target's army by 1. Tireless March can only be cast on one unit at a time.</Description>
<Image>S_TirelessMarch_Painting.png</Image>
<IconFG>S_TirelessMarch_Icon.png</IconFG>
<CanStack>0</CanStack>
<SpellBookSortCategory>Unit</SpellBookSortCategory>
<SpellBookSortSubCategory>UnitEnchantment</SpellBookSortSubCategory>
<SpellType>Strategic</SpellType>
<SpellClass>Defensive</SpellClass>
<SpellSubClass>Buff</SpellSubClass>
<SpellTargetType>FriendlyChampionOrSov</SpellTargetType>
<!--<UniqueSpellUnlock>TirelessMarch</UniqueSpellUnlock>-->
<SpellResourceCost>
<Resource>Mana</Resource>
<Amount>30</Amount>
</SpellResourceCost>
<SpellResourceCost>
<Resource>Mana</Resource>
<PerTurn>1</PerTurn>
<Amount>1</Amount>
</SpellResourceCost>
<GameModifier>
<ModType>Unit</ModType>
<Attribute>AdjustArmyStat</Attribute>
<StrVal>UnitStat_Moves</StrVal>
<Duration>-1</Duration>
<Value>1</Value>
</GameModifier>
<!--<GameModifier>
<ModType>Unit</ModType>
<Attribute>UnlockSpell</Attribute>
<StrVal>TirelessMarch</StrVal>
<Duration>-1</Duration>
</GameModifier>-->
<AIData AIPersonality="AI_General">
<AIPriority>5</AIPriority>
</AIData>
<HitSoundFX>Spell_TirelessMarch_01</HitSoundFX>
<SpellCastEffectName>T_Erosion_Particle</SpellCastEffectName>
<SpellCastEffectScale>1</SpellCastEffectScale>
<SpellCastProjectile>1</SpellCastProjectile>
<SpellCastProjectileSpeed>700</SpellCastProjectileSpeed>
<SpellDefEffect>
<EffectName>T_ErosionImpact_Particle</EffectName>
<LocalPosition>0,0,0</LocalPosition>
<EffectScale>0.5</EffectScale>
<EffectDelay>0</EffectDelay>
<SnapToTerrain>1</SnapToTerrain>
</SpellDefEffect>
</SpellDef>

</panpiper>

Your caution however that modifying the spell as I originally suggested would result in it theoretically being stackable by casting it on multiple units in the same army, was apt. I opted to create a new spell, as you suggested, but instead of giving it an 'AdjustArmyStat' I gave it an 'AdjustUnitStat' instead. This way it will achieve much the same effect as I initially desired, getting multiple hero stacks to move a tad faster, without being abusable. It will of course wind up costing more mana maintenance, but that is more than valid. The code I used for that, that seems to work was:

<?xml version="1.0"?>

<panpiper>

</SpellDef>
<SpellDef InternalName="Speed">
<DisplayName>Speed</DisplayName>
<Description>Target unit gains one point of extra speed.</Description>
<Image>S_TirelessMarch_Painting.png</Image>
<IconFG>S_TirelessMarch_Icon.png</IconFG>
<AutoUnlock>1</AutoUnlock>
<CanStack>0</CanStack>
<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>
<SpellResourceCost>
<Resource>Mana</Resource>
<Amount>15</Amount>
</SpellResourceCost>
<SpellResourceCost>
<Resource>Mana</Resource>
<PerTurn>1</PerTurn>
<Amount>1</Amount>
</SpellResourceCost>
<GameModifier>
<ModType>Unit</ModType>
<Attribute>AdjustUnitStat</Attribute>
<StrVal>UnitStat_Moves</StrVal>
<Duration>-1</Duration>
<Value>1</Value>
</GameModifier>
<AIData AIPersonality="AI_General">
<AIPriority>20</AIPriority>
</AIData>
<HitSoundFX>Spell_Enchant_04</HitSoundFX>
<SpellDefEffect>
<EffectName>T_StoneSkin_Particle</EffectName>
<LocalPosition>0,25,0</LocalPosition>
<EffectScale>0.5</EffectScale>
<EffectDelay>0</EffectDelay>
<SnapToTerrain>1</SnapToTerrain>
</SpellDefEffect>
</SpellDef>

</panpiper>

Edit: Argh. 'Code' tags don't work, neither do 'spoiler' tags. Is there no way to create a shrinkable section of a post, so people who don't want to read code, don't have to see it?

Reason for Karma (Optional)
Successfully updated karma reason!
June 22, 2014 1:26:57 PM from Elemental Forums Elemental Forums

N/A

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108433  walnut3   Server Load Time: 00:00:00.0000157   Page Render Time: