Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   How-To: Add a bonus to all save DC's (http://forums.wolflair.com/showthread.php?t=46335)

Dackad November 3rd, 2013 07:51 PM

How-To: Add a bonus to all save DC's
 
Hi, first time poster, long time reader here.

I'm trying to create a template in the editor and one of its special abilities adds a +2 bonus to each special ability (including spell-like abilities) that the creature has. I've managed to mine some code from other things in the editor, but I can't get my code to work. Right now, it just doesn't do anything.

Here's what I have so far:

Code:

[Phase=Final Phase; Priority=10000; Index=1]
foreach pick in hero from RaceAbil where "(component.Ability & fieldval:abDC <> 0) | (component.BaseSpell & Helper.SpellLike & (sSave.Fort? | sSave.Ref? | sSave.Will?))"

      eachpick.field[abDC].value += 2

nexteach

I'm not sure if eachpick works in that way or if it's something else in my code. I tried using the #dc macro, but it didn't recognize eachpick and it gave me an error so I'm not sure what else to try here.

Thanks

Mathias November 3rd, 2013 08:22 PM

#1: You're restricting this to RaceAbil - that means you're leaving out all class abilities, spell-like abilities built from spells, and generic abilities.

#2: Timing: Your expression requires that abDC already be finished calculating, so that it's non-zero, but then you want to add more to abDC, which has to happen before abDC's final value is calculated.

ShadowChemosh November 3rd, 2013 08:23 PM

My quick idea is your way to late in timing by using Final. Adding bonus should be pre-levels or post-levels at the latest. Trying changing your timing to pre-levels and see what it does.

Aaron November 4th, 2013 12:05 PM

Also, you need to fork your addition within the foreach. Spells store their DCs in the sDC field, while abilities store it in abDC. Adding to the wrong field will throw errors. I'd do something like:

Code:

[Phase=Final Phase; Priority=11000; Index=1]
    foreach pick in hero where "(component.Ability & fieldval:abDC <> 0) | (component.BaseSpell & Helper.SpellLike & (sSave.Fort? | sSave.Ref? | sSave.Will?))"
      if (eachpick.tagis[component.Ability] <> 0)
        eachpick.field[abDC].value += 2
      elseif (eachpick.tagis[component.BaseSpell] <> 0)
        eachpick.field[sDC].value += 2
        endif
      nexteach


Mediator9292 April 7th, 2023 12:03 PM

Code:

[Phase=Final Phase; Priority=11000; Index=1]
    foreach pick in hero where "(component.Ability & fieldval:abDC <> 0) | (component.BaseSpell & Helper.SpellLike & (sSave.Fort? | sSave.Ref? | sSave.Will?))"
      if (eachpick.tagis[component.Ability] <> 0)
        eachpick.field[abDC].value += 1
      elseif (eachpick.tagis[component.BaseSpell] <> 0)
        eachpick.field[sDC].value += 1
        endif
      nexteach

Should this still be a valid script after 7+ years? I'm trying to achieve a similar effect (+1 instead of +2 to all spell-like abilities and spell save DCs) as a feat (fArcAdept), but I get the following error message:

Syntax error in 'eval' script for Thing 'fArcAdept' (Eval Script '#1') on line 2
-> Invalid use of reserved word 'if' in script

TCArknight April 7th, 2023 12:37 PM

Quote:

Originally Posted by Mediator9292 (Post 301271)
Code:

[Phase=Final Phase; Priority=11000; Index=1]
    foreach pick in hero where "(component.Ability & fieldval:abDC <> 0) | (component.BaseSpell & Helper.SpellLike & (sSave.Fort? | sSave.Ref? | sSave.Will?))"
      if (eachpick.tagis[component.Ability] <> 0) then
        eachpick.field[abDC].value += 1
      elseif (eachpick.tagis[component.BaseSpell] <> 0) then
        eachpick.field[sDC].value += 1
        endif
      nexteach

Should this still be a valid script after 7+ years? I'm trying to achieve a similar effect (+1 instead of +2 to all spell-like abilities and spell save DCs) as a feat (fArcAdept), but I get the following error message:

Syntax error in 'eval' script for Thing 'fArcAdept' (Eval Script '#1') on line 2
-> Invalid use of reserved word 'if' in script

I've run into this a lot working with my own datasets. You just need to add a then on the end of the if and elseif lines. (I've added them in the lines above if just want to paste...

Mediator9292 April 8th, 2023 09:42 AM

*slaps forehead* That seems so obvious in hindsight, and works perfectly! Thank you!


All times are GMT -8. The time now is 10:33 PM.

Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.