Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Dackad
Junior Member
 
Join Date: Nov 2012
Posts: 1

Old November 3rd, 2013, 07:51 PM
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
Dackad is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old 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.
Mathias is online now   #2 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old 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.

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.
ShadowChemosh is offline   #3 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old 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
Aaron is offline   #4 Reply With Quote
Mediator9292
Member
 
Join Date: Apr 2018
Location: New York
Posts: 45

Old 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
Mediator9292 is offline   #5 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old April 7th, 2023, 12:37 PM
Quote:
Originally Posted by Mediator9292 View Post
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...

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #6 Reply With Quote
Mediator9292
Member
 
Join Date: Apr 2018
Location: New York
Posts: 45

Old April 8th, 2023, 09:42 AM
*slaps forehead* That seems so obvious in hindsight, and works perfectly! Thank you!
Mediator9292 is offline   #7 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:42 AM.


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