Mana Regeneration in Modding

Question:  As far as the 1.1 changes, what XML tags and so forth works as far as affecting mana regeneration?  Before, you could increase essence and even add mana regen in tactical situations.  What still works and what's now broken?  What is new?

4,602 views 8 replies
Reply #1 Top

I see the tag <StrVal>UnitStat_Essence</StrVal> used on some artifacts in the Artifact mod.  I thought all Essence stat did was "Turn On" the spellcaster ability?

 

Reply #2 Top

Yeah, you're right. Would be used as a free Imbue, I'm assuming.

Also you can use something like:

    <GameModifier InternalName="Mana">
      <ModType>Resource</ModType>
      <Attribute>Mana</Attribute>
      <Value>20.0</Value>
      <Duration>0</Duration>
    </GameModifier>

for example to have spells output mana. Or add the <PerTurn>1</PerTurn> tag to give a certain amount per turn. Haven't tried this in tactical spells, though. Hope this helps!

Reply #3 Top

Does the A_ManaRegeneration AbilityBonus still control how fast your faction regenerate mana?

Reply #4 Top

That I don't know, but I'm guessing that this is left over from when mana was a local resource...

Reply #5 Top

It would appear that that mana is now a resource meaning it's at the player level.  I found a building that increases the Mana Resource and can do so per turn.  Has anyone run across a player level flag that determines the rate a faction gains mana?

Reply #6 Top

Modders can still use essence as a per-unit mana resource.

In the next release of expandedfactions there will be an elven unit called Bladedancer that can alternate between two stances, one favoring defense and one attack. This is how I accomplished that:

In the unittype, give the unit
<UnitStat_Essence>3</UnitStat_Essence>
<UnitStat_TacticalManaRegen>1</UnitStat_TacticalManaRegen>

then in the spelldefs use

<Manacost>3</Manacost>
(and make all modifiers duration 3)

The unit now uses internal mana to use these abilities. An ability costs 3 essence to use, which means the unit must see the start of another 3 turns before it can use an ability again.

 

Keep in mind to give the unit a very low intelligence (1), otherwise it will be able to cast spells from the spellbooks.

Reply #7 Top

Quoting Heavenfall, reply 6
Modders can still use essence as a per-unit mana resource.

In the next release of expandedfactions there will be an elven unit called Bladedancer that can alternate between two stances, one favoring defense and one attack. This is how I accomplished that:

In the unittype, give the unit
<UnitStat_Essence>3</UnitStat_Essence>
<UnitStat_TacticalManaRegen>1</UnitStat_TacticalManaRegen>

then in the spelldefs use

<Manacost>3</Manacost>
(and make all modifiers duration 3)

The unit now uses internal mana to use these abilities. An ability costs 3 essence to use, which means the unit must see the start of another 3 turns before it can use an ability again.

 

Keep in mind to give the unit a very low intelligence (1), otherwise it will be able to cast spells from the spellbooks.
End of Heavenfall's quote

Wow, that's really weird that they kept that system still in place. I'm assuming there is no way to see what their current Mana amount is, though?

Also, did you run across a situation where that unit (with enough intelligence and essence) could cast spells on the Strategic map, but not the Tactical? Just curious as to if they fixed that in the latest patch... probably not.

Reply #8 Top

Yes, essence in this sense causes units to be able to cast strategic spells, but not tactical spells. They can still use manacost on unlocked abilities.