• 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

Way to replace one bonus with another?

coyote6

Well-known member
I'm trying to implement the Steadfast Determination feat, from PH2 (the 3.5e PH2); it allows the character to use their Con modifier instead of their Wis modifier for Will saves. Is there any way or function that will allow me to easily replace the Wis modifier with the Con mod (if it's larger)?

I tried this, in the Eval Scripts section:

~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

container.child[vWill].field[Bonus].value += hero.child[aCON].field[Bonus].value - hero.child[aWIS].field[Bonus].value

But it doesn't do anything. I tried setting the Phase to Final, Post-Attributes, & Pre-Attributes, but it didn't make any difference. The Will save bonus doesn't change.

I also tried using hero.child[vWill]..., but didn't work.

What am I missing?
 
From the Tactile Trapsmith feat I wrote, which lets you use Dex rather than Int for Disable Device and Search. Change as needed

It runs at Post Attributes 10000
var bonus as number
var minus as number
bonus = hero.child[aDEX].field[aModBonus].value
minus = hero.child[aINT].field[aModBonus].value
if (minus >= bonus) then
done
endif

~ Since our dexterity is higher and we passed, subtract intelligence from our Disable Device and Search checks and add dexterity instead.

hero.childfound[kSearch].field[Bonus].value = hero.childfound[kSearch].field[Bonus].value - minus + bonus
hero.childfound[kDisable].field[Bonus].value = hero.childfound[kDisable].field[Bonus].value - minus + bonus
 
The attribute bonus for a save is stored in vAttr. The Bonus field is for generic bonuses added by external things, for example, the Halfling's racial save bonus.

vAttr is calculated at PostAttr/10000, and incorporated into vTotal at Final/7500, so you'll have to put your script inbetween those two points.

PostAttr/11000:
Code:
~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

hero.child[vWill].field[vAttr].value = maximum(hero.child[vWill].field[vAttr].value, hero.child[aCON].field[aModBonus].value)

That ought to get you what you want. It sets the attribute bonus for the will save to the maximum of the attribute bonus for the will save, and the constitution modifier.

For future reference, I got those fields from the editor manual. Select the help menu in the editor, then scroll down a tad to the "Reference Information" link. The exact timing is something you had to ask me for. Since the attribute bonus to a save is something that happens after attributes are calculated, you could guess that the value would be calculated sometime in the Post Attributes phase. For things like saving throws, that depend on many other things, but aren't incorporated into anything else, they'll generally be calculated in the Final phase. So from that, you might guess that late in the Post Attributes phase might be the time to check the existing bonus, and then modify it before it was used by something else.


container.child[vWill] will take you to the same thing as hero.child[vWill] in 99% of cases. It's that 1% that's a problem. Where'd you see container.child[] being used? I'll switch that over to hero.child[] so it's a better example. For those who are curious, if a container transition was used from an item power, it would take you to the item, and from there, the child[vWill] transition would fail, so it would return an error. From most anywhere else, the container is the hero.
 
That did it! Thanks.

For future reference, I got those fields from the editor manual. Select the help menu in the editor, then scroll down a tad to the "Reference Information" link. The exact timing is something you had to ask me for.

Yeah, I skimmed the help file, but flat missed the vAttr. I blame the football game. :) The timing stuff was just guesses, thinking maybe things were being evaluated at the wrong time.

container.child[vWill] will take you to the same thing as hero.child[vWill] in 99% of cases. It's that 1% that's a problem. Where'd you see container.child[] being used?

Iron Will feat; I copied a few feats over to look at how they were set up, and Iron Will was amongst the first. FWIW, I just checked & Great Fortitude and Lightning Reflexes also use container.child[].

I think I actually tried hero.child[] at one point, but it didn't work, and I went back to what Iron Will used, on the theory that the core feat might've done it for a reason. Didn't think about "old code" as the reason. :)
 
Back
Top