![]() |
Junior Member
Join Date: Nov 2012
Posts: 1
|
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 Thanks |
![]() |
![]() |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,169
|
#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. |
![]() |
![]() |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,730
|
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.
Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
![]() |
![]() |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
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 |
![]() |
![]() |
Member
Join Date: Apr 2018
Location: New York
Posts: 36
|
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 Syntax error in 'eval' script for Thing 'fArcAdept' (Eval Script '#1') on line 2 -> Invalid use of reserved word 'if' in script |
![]() |
![]() |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,314
|
Quote:
Working on - |
|
![]() |
![]() |
Member
Join Date: Apr 2018
Location: New York
Posts: 36
|
*slaps forehead* That seems so obvious in hindsight, and works perfectly! Thank you!
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|