• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Reducing Metamagic costs

Lord Magus

Well-known member
I have been working on the Incantatrix PrC for the last few days, as my first "serious" HeroLab project.

I am stumped by the coding for the class capstone, which allows all Metamagic feats to be used at -1 level cost (minimum cost stays 1). (I can't find a similar ability with code to resolve this.)

Also, I want to make sure that Metamagic feats costing zero (eg Energy Substitution) will stay at 0, and hypothetic Metamagic feats (none like that in the 3.5 books IIRC) that would LOWER the level cost will also keep their original cost.

So Maximize Spell would become +2, Quicken Spell +3, Energy Substitution +0 and (if it existed) Feeble Spell -1.

Thanks for the help!
 
Last edited:
So far, I have tried variations on

hero.child[Metamagic].field[mmLevel].value = hero.child[Metamagic].field[mmLevel].value - 1
(tells me there is no such thing as Metamagic)

and
#applypenalty[Penalty, hero.child[mmLevel].field, -1]
(not working either)
 
I'm down to

Code:
foreach pick in hero from ???? where "fCategory.Metamagic"
if eachpick.field[mmLevel].value <2
then do nothing
else
   eachpick.field[mmLevel].value -= 1
endif
nexteach

I just have no clue what should replace the ???, or if the syntax is otherwise OK.
 
You can probably just leave out the from part of the statement.

Code:
foreach pick in hero where "fCategory.Metamagic"
   if (eachpick.field[mmLevel].value >= 2) then
      eachpick.field[mmLevel].value -= 1
   endif
nexteach
 
Thanks for the help... however...

Syntax error: only derived fields can generally be modified via scripts (field mmLevel)
 
The mmLevel field is set to a value and not derived. As I remember Mathias saying, you would have to change them to be set rather than modified. For example,

Code:
hero.child[fQuickSpl].field[mmLevel].value = 3

which will modify Quicken Spell to use 3 slots instead of 4. I'm not sure if that would result in a system wide change though, as I have not played around with metamagics to find out. Probably Mathias or someone who has done metamagic changes before can help you with that answer. In any case, you'll have to set each one individually to get it to work, assuming it only changes it for the current hero.
 
Actually, Kendall, since you know how to use the debugging tools, would you be able to help with this question? I've got two deadlines within the next week, so I won't have the time I'd need to figure out how to do this until at least the end of next week.

Since he's run into a user field, and authors should always avoid having to change those in a script, why not take a look at the custom spell itself, and figure out how the mmLevel of the metamagic is turned into a modification to the level of the spell - modify the spell instead of the metamagic. Or, see if the way that heighten spell, which has a user-controlled addition to the spell level differs from the metamagics with a fixed addition to the spell levels - maybe the information is stored differently in each case, and there's another field than mmLevel that can accomplish what he's trying to achieve. (I apologize, it's been a while since I've had to delve into the mechanics of metamagics, so I don't remember all the details off-hand).
 
I have thought of another strategy, since a direct general modifier to mmLevel seems to be a no-no. By the way, the ability I'm trying to translate is Improved Metamagic, which is the capstone ability for the Incantatrix prestige class from Player's Guide to Faerun. It reduces the cost of all metamagic feats used by 1 level, down to a minimum cost of 1.

Would it be possible to create a Metamagic thing (mm???) that would be bootstrapped not to a metamagic feat, but to a class special ability, and which would grant a -1 "penalty" to spell level. That metamagic thing would in turn automatically be applied (through the class ability script?) to spells modified by other metamagic feats, a number of times equal to the number of mm feats with lvl adjust >1 applied to the base spell.

For example, for a quickened (+4), empowered (+2), energy substitution (+0) fireball, the metamagic thing (-1) would be applied twice (as energy subst. has a lvl adjust <=1)

---------

I've seen in old posts that earlier versions of HeroLab only supported metamagic level adjustments >=1, is that still true?


Sorry about all this, that is the last ability I need to code before the Incantatrix is complete... and my day job is physician, not programmer!

Thanks a lot!
 
I first tried to create a metamagic feat called Improved Metamagic, with a level adjustment of -1. It does not cause bugs, but when I try to apply it to a spell its (the feat's) level adjustment is brought to 0. So it seems negative metamagic level adjustments can't be used.

I'll submit that as a request for a future feature.
 
Last edited:
Been trying to get to this and help you out, but I have been extremely busy lately. I should have a chance tomorrow or the next to give it a look.
 
I've gotten this to work in a test wizard type class. Because the metamagic scripting that determines level and how it is applied is encapsulated and hidden from user modification, there is nothing I can do about what the metamagic feat reports as the new spell level when you apply the metamagic feat to a spell. However, the spell itself uses up the correctly modified slot for the Incantatrix special ability (-1 level to the metamagic).

There is another problem though. Metamagic applied spells have no memory of what metamagic feat was applied to it. HL creates a temporary custom spell, modifies its name to the modified spell's name with the metamagic title added on ("Maxim, Quick, Still, etc.) and modifies the spell level to the new spell level. This means, I have no idea how to tell which feat got applied, or how many of them. I've tried a few different methods, and the one I'd like to work out is to get the sLevel of the gizmo (spell) that is being modified. I'm not entirely sure how to do that, but if there is a way to do that, I can take the difference of the gizmo spell and the metamagic spell. Unfortunately, this causes another problem in any case, because if you apply multiple +1 metamagics to a spell, this will lead to a false positive on that difference. So, I'm not sure that can be fixed, a real conundrum.

As it stands, this works for applying a single metamagic. It just doesn't have a way to limit which metamagics get the -1 applied and which do not. As a GM, you might have to enforce it yourself, since there is no way to figure out if a +1 or less metamagic is being applied. This is the best I could do in the time I had available, use this as a starting point to getting the code to work as you'd like.

Code:
<<Pre-Levels (users) 10000>>
~ Determine new metamagic spell level.
foreach pick in hero where "thingid.sCustomSpl"
  if (eachpick.field[sLevel].value > 1) then
     eachpick.field[sLevel].value -= 1
  endif
nexteach

Alternate version, with difference possiblity (psuedo-code, don't use, this is strictly for others to puzzle out or if they can find a better way.)

Code:
var diff as number
foreach pick in hero where "thingid.sCustomSpl"
  ~ Difference of actual spell level vs. the metamagic spell level.
  ~ Would still need to track for multiple applications of metamagics to a spell.
  diff = eachpick.field[sLevel].value - <gizmo sLevel, parent non-existent>
  if (diff > 1) then
    eachpick.field[sLevel].value -= 1
  endif
nexteach

Have no idea how to check if multiple metamagics were applied to the spell. In truth, I just don't have enough experience with gizmos.
 
Last edited:
Thanks a lot!

And to think I started this out thinking this ability would be rather easy to devise...

Another way to try to do it would be to create an ability (feat-like) that could be applied to spells by the user to reduce its level (kind of a reverse Heighten Spell), so the user could manually adjust the spell's level. Again, not sure how to do this: I don't think Heighten Spell allows for negative modifiers.
 
Nope... can't work around metamagic feats' inherent limitations (no negative value, HL not keeping track of the individual modifiers to spell level).

What I was hoping to do now is to systematically recreate "improved" versions of all MM feats in the community files with a lvl adjustment >1, give those prerequisites of the original metamagic feat as well as the Improved Metamagic class special, and bootstrap those to that same Improved MM class special. Roughly, does that seem feasible?
 
Not sure if you ever got this done, but I found that this works



Code:
~<Pre-Levels (users) 10000>>
~ Determine new metamagic spell level.
var x as number
foreach pick in hero where "thingid.sCustomSpl"
   x = 0
   if (eachpick.tagis[HasMetaMag.?] <> 0) then
    foreach pick in eachpick.gizmo from BaseMetamg
        if (eachpick.field[mmLevel].value > 1) then
            x += 1
        endif
     nexteach
    endif
    eachpick.field[sLevel].value -= x
nexteach
 
Not sure if you ever got this done, but I found that this works



Code:
~<Pre-Levels (users) 10000>>
~ Determine new metamagic spell level.
var x as number
foreach pick in hero where "thingid.sCustomSpl"
   x = 0
   if (eachpick.tagis[HasMetaMag.?] <> 0) then
    foreach pick in eachpick.gizmo from BaseMetamg
        if (eachpick.field[mmLevel].value > 1) then
            x += 1
        endif
     nexteach
    endif
    eachpick.field[sLevel].value -= x
nexteach

Gives an Error:

Hero Labs was forced to stop compilation after the following errors were detected:

Syntax error in 'eval' script for Thing 'cMissMetaMa' (Eval Script '#1') on line 6
-> Group 'HasMetaMag' not defined

Also, I'd love to have the file for the Incantrix or even Hathran if it exists.
 
Odd, I just was setting up the dweomerkeeper from F&P, which has a similar feature. I just added that in, copied this script, and it is working correctly. The HasMetaMagic tag should exist. It appears to be assigned to any spell modified by MetaMagic. Note that I am using Pathfinder ruleset, so if this is different for you, just look at the tags for a spell modified by metamagic, find the modifying field, and change the script above accordingly.
 
Last edited:
Hrm, I kinda abandoned this because I couldn't get it to work right. I was creating the prestige Metaphysical Spellshaper, from the BoEF and this is the capstone of that class as well and it failed.

I also still don't know enough about how the foreach works to try and tinker with it. I'm sure it would solve alot of my problems if I did but I just havent had the time to jump into a new area when I was working on debugging what I already have.

But if you are doing the dweomerkeeper, I'd love to see if I can port it over to the 3.5 set. As it is part of the Faerun stuff, along with anything else for the Forgotten Realms Campaign Setting. Though I have no idea how hard converting is, I've not really tried.
 
Back
Top