• 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

Animal Companion Spell Resistance

TheIronGolem

Well-known member
I'm working on a class special that grants SR to an animal companion. Seems like it should be easy enough, but I can't seem to get it working. No matter what timing I try, I can't seem to access xSplRs on the minion, even though it has clearly been bootstrapped.

My code (Currently at Post-Attr/10000, though I've tried several others):

Code:
      ~ Stop now if we don't have an animal companion active
      doneif (hero.childlives[cAnimComp] = 0)

      ~ Add SR to animal companion
      perform hero.childfound[cAnimComp].minion.childfound[xSplRs].setfocus
      doneif (state.isfocus = 0)

      focus.minion.childfound[xSplRs].field[abValue].value = maximum(focus.minion.childfound[xSplRs].field[abValue].value, field[xAllLev].value + field[abValue].value)

This never gets beyond the second doneif. Not sure what I'm doing wrong, because this seems to be pretty much how the paladin applies SR to its mount in the animcompSR procedure.
 
animcompSR does not set a focus first, so you're mixing in two different things.

animcompSR's final line is
Code:
minion.child[xSplRs].field[abValue].value = maximum(minion.child[xSplRs].field[abValue].value, spellres)
But yours is:
Code:
focus.minion.childfound[xSplRs].field[abValue].value = maximum(focus.minion.childfound[xSplRs].field[abValue].value, field[xAllLev].value + field[abValue].value)
So by starting from the focus, you're trying to travel to different places than animcompSR is traveling.
 
I see what you're talking about with the last line. That's an artifact of my previous efforts. But I'm not even getting that far; I'm not able to set the focus to xSplRs in the first place, almost as if it weren't bootstrapped.
 
So, sounds like time for some debugs:
Code:
debug "Beginning of the script"
      ~ Stop now if we don't have an animal companion active
       doneif (hero.childlives[cAnimComp] = 0)
debug "There is an animal companion"
        ~ Add SR to animal companion
       perform hero.childfound[cAnimComp].minion.childfound[xSplRs].setfocus

       doneif (state.isfocus = 0)
debug "The focus was set"
        focus.minion.childfound[xSplRs].field[abValue].value = maximum(focus.minion.childfound[xSplRs].field[abValue].value, field[xAllLev].value + field[abValue].value)
debug "The SR is currently: " & focus.minion.childfound[xSplRs].field[abValue].value
If you haven't used debugs yet, in the Develop menu, choose Floating Info Windows at the bottom, and then choose "Show Debug Output".
 
Last edited by a moderator:
Ah, sorry, I should have mentioned that I have been using debug (well, notify, but whatever), which is how I know I'm not getting past the state.isfocus check. I removed those from my post for clarity's sake. So I see "Beginning of the script" and "There is an animal companion", but nothing after that.
 
Okay, then what's the script you got that next line of code from? Let's see the original in context, so we can figure out if there are any changes that would make that function differently than your script functions.
 
I'm not really sure how to answer that. I didn't copy that last line from anywhere, I just wrote it that way expecting it to work. When it didn't, I hunted down the animcompSR procedure to see if it did things differently.

But here's what the code currently looks like, as it currently is in my editor:

Code:
      ~ Stop now if we don't have an animal companion active
      doneif (hero.childlives[cAnimComp] = 0)
notify "found AC"
      ~ Add SR to animal companion
      perform hero.childfound[cAnimComp].minion.childfound[xSplRs].setfocus
      doneif (state.isfocus = 0)
notify "found SR"
      focus.field[abValue].value = maximum(focus.field[abValue].value, field[xAllLev].value + field[abValue].value)
notify "SR is now " & focus.field[abValue].value
 
Last edited:
Tell me about your test character, because something else is happening here that's preventing this from working.
 
What the heck? Now it's working...

Okay, so here's what I did:

The class I'm working on is really complicated and relies on a whole new third-party subsystem for Pathfinder (the Hedgewitch from Spheres of Power, if you're curious). So rather than try to describe it and make you sift through a ton of extraneous information, I decided to make a whole new test class that had nothing but this class special (and Animal Companion), and then start adding elements of the real class until I figured out what was breaking the SR.

Once I did that and created a character with a level in the test class, it worked. And the strange thing is, it not only worked on the new test character, it also started working on the one for the actual class, despite my having made no changes to that class or the ability.

I'd be tempted to credit this to the reload of the game system I did after making the new class, but I've been reloading it a bunch of times during my other testing and troubleshooting anyway.

You know what? Gremlins. I'm going with gremlins on this one.

Seriously though, Mathias, thanks for your help. You got me headed in the right direction, even if I still don't know which direction that is.
 
Last edited:
Back
Top