• 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

Increasing Difficulty Check

Kerokus

Member
Heya!

Okay, so I posted earlier with roughly ten thousand questions in reference to making adjustments for the "saint" in Pathfinder.

Well, I managed to get the template up and running, with all adjustments made except for one:

One of the attributes for a Saint is this: "The save DCs of any and all of the saint's special attacks, including spells as well as spell-like, supernatural, and extraordinary abilities, increase by +2."

So basically, if I cast a spell that has a DC 28 fort save, it's now a DC 30 fort save. Now, I have the ability listed in the "specials" column just to give me a heads up that it's there, but I was wondering if there's an actual eval script I can write that will automatically boost the DCs listed on the character sheet?

I was hoping to just alter and copy the scripting of a feat or something, but I actually can't find a feat or an item that does this, so I'm thinkin it may not be possible.

Thoughts?
 
It is possible, you'll have to do a foreach that cycles through all spells and adds +2 to the sDC field

Then do a foreach that cycles through all abilities and adds to the abDC field for those.

Here's an example off the top of my head, you may have to adjust it since it isn't tested.

PostAttr 20000
Code:
      foreach pick in hero from BaseSpell where "fieldval:sDC > 0"
        eachpick.field[sDC].value += 2
        nexteach

      foreach pick in hero from Ability where "fieldval:abDC > 0"
        eachpick.field[abDC].value += 2
        nexteach
 
Code:
      foreach pick in hero from BaseSpell where "fieldval:sDC > 0"
        eachpick.field[sDC].value += 2
        nexteach

      foreach pick in hero from Ability where "fieldval:abDC > 0"
        eachpick.field[abDC].value += 2
        nexteach
Wait a minute. Are you saying that Foreach is smart enough to search on "field values" also? Looks like the same similar logic that is used for bootstrap conditions. OMG I thought we could only do tags.

That is going to come in very handy. Can it do a combination search of tags and values? ie
Code:
where "fieldval:sDC > 0 & sClass.cHelpWiz"
 
Tag expresions work the same throughout Hero Lab. They're the same in the where portion of a foreach as they are in a bootstrap condition.
 
Code:
      foreach pick in hero from BaseSpell where "fieldval:sDC > 0"
        eachpick.field[sDC].value += 2
        nexteach

      foreach pick in hero from Ability where "fieldval:abDC > 0"
        eachpick.field[abDC].value += 2
        nexteach

Okay, this is weird. I used this block, and while my Ability DC (ie, Channel Positive Energy) went up by two, my spells did not change.

I originally had both lines in the same eval script, so I put each foreach line into a separate script hoping that would fix the problem and it did not.

So now I'm trying to troubleshoot =)

Looking at the code, I have a couple of questions: Reading the line implies that BaseSpell is a table (or collection, etc). Are ALL of the spells in this table? And do they all have a field called sDC? Cause this reads kind of like like psuedo-SQLish (yeah that's a word now)

So, my guess would be that:
(1) the table (BaseSpell) does not exist OR
(2) that the where-clause condition (where "fieldval:sDC > 0") is failing

If (2) is true then either:
(a) the field (sDC) dont exist or
(b) it is always <= 0

Thoughts on this?
 
BaseSpell is a "component". Components define a set of fields. So for example the BaseSpell component defines the sDC field, the sCL field, and the sSchool field (as well as several others).

When troubleshooting, use debug statements to determine things. For example, if I wanted to determine if my foreach was getting to the correct spells, I'd add to the code like this:

Code:
    foreach pick in hero from BaseSpell where "fieldval:sDC > 0"
debug "We found a spell and are adding to the DC! This spell we found has the unique id of " & eachpick.idstring
        eachpick.field[sDC].value += 2
        nexteach

To see debug messages, go to the develop menu and Enable Data File Debugging, and then go to "Develop -> Floating Info Windows -> Show Debug Output"

If you see messages popping up there, you know your foreach is finding spells with sDC higher than 0.

If you don't see any messages, then you know it isn't, and my guess for why would be timing. If your script is running too early, it will be before the program generates the DC of the spell. Looking into it, my initial timing of Post Attribute 20000 is too early, I see that the sDC field isn't calculated until Final 26000, so try running the script after that.
 
Okay, I think I'm making progress.

Aaron, I found a post where you helped someone out back in April who was trying to raise the DC on a particular spell by 1 (The post here )

The code you suggested was:

Code:
 foreach pick in hero from BaseSpell where "SpellEff.DamFire"
eachpick.field[sDC].value += 1
nexteach

Now, he was saying this worked for him, whereas what I have does not. This suggests that the problem lies in the "fieldval:sDC > 0" part of the line.

What confuses me though is why it worked for abilities but not spells. I'M SO CLOSE! lol
 
...and I was about to search around the program for this very thing, to apply it to a Marrowstone Golem Necrotic Aura adjustment I wanted to create. Case closed!

Thanks everybody and happy holidays to all of you!
 
Back
Top