|
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Hi everyone, I’m trying to create a custom ability in the editor that scales by level. The ability confers a +1 competence bonus to the Stealth skill, and then adds another +1 for every four class levels (i.e. +2 at 4th level, +3 at 8th level, etc.)
I tried using the following eval script: #competencebonus[hero.child[skStealth].value, .value += 1] But when tested, I get an error: “Syntax error in ‘eval’ script for Thing ‘cBLAssDri’ (Eval Script #1) on line 4 -> Invalid use of reserved word ‘hero’ in script Do I just have the syntax messed up, or is there a better way of creating a scaling ability in the editor. Thanks as always. |
#1 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
The syntax you want for that is;
Code:
#competencebonus[hero.child[skStealth], 1] If you are not on a mac you'll find it at; file:///C:/ProgramData/Hero Lab/data/pathfinder/authoring/pathfindereditwhere.htm |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
I recommend reading THIS post I did where I break down the Generic Class Ability Script logic. It should cover you 99% of the time for any ability that scales with levels.
Its very flexible and really most of the control is based on the levels you bootstrap NOT in the actual script. 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. |
#3 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Quote:
|
|
#5 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
Listname is the field name that is displayed on classes tab name when you click the star: Image3.png xCount is a field that is defined on all Class Abilities Things. In addition xCount automaticlaly increases its value as more abilities become active. So if you have an ability bootstrapped at levels 1, 4, 8, 12, etc. Then when a character is level 1 to 3 xCount = 1. When character level is 4-7 xCount = 2. Etc. Put this script on your ability at Post-Level/10000: Then bootstrap it at the correct levels when the bonus increases 1,4,8, etc. You will see the bonus all work without having to know anything else about your ability: Code:
~ Set the list name field[listname].text = field[thingname].text & " " & field[xIndex].value ~ If we're not shown, just get out now doneif (tagis[Helper.ShowSpec] <> 1) ~ if we've been disabled, get out now doneif (tagis[Helper.SpcDisable] <> 0) ~ Set the bonus based on the number of active abilities field[abValue].value += field[xCount].value field[livename].text = field[thingname].text & " " & field[abValue].value ~ The following should only happen once on the first copy doneif (tagis[Helper.FirstCopy] = 0) ~ Give a Competence Bonus (BonComp) to the Stealth Skill #applybonus[BonComp,hero.child[skStealth],field[abValue].value] 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. |
|
#6 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Hmm, it worked, but not as intended. Let me explain the design of the ability:
At first level, the character receives a Custom Special called Combat Drills. Two such drills can be selected at first level. I set up the Custom Special, called Combat Drills, on the Class tab. I designated what levels the character would be able to select specific drills on that tab as well. I then went into the Custom Special tab, and created each of the drills on that tab. One of them is the ability we have been discussing. I could not find anything to bootstrap the ability to, except to the class itself. This automatically added the ability to the hero, skipping the selection of the Combat Drills. I don't know if any of this helps you diagnose what the issue is, but I really appreciate your insight and experience. |
#7 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Well, I figured it out.
I used the following code: ~if we're not activated, just get out now doneif (field[abilActive].value = 0) ~ Adjust our total bonus field[abValue].value += round(field[xTotalLev].value / 4, 0, -1) + 1 ~ Give a Competence Bonus (BonComp) to the Stealth Skill #applybonus[BonComp,hero.child[skStealth],field[abValue].value] I'm not entirely sure what it means, but it worked, so what the heck! Thanks everyone. |
#8 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Yeah sorry I am an idiot. You said custom ability but I read "Class Ability" like Sneak Attack that increases as you level automatically. I did the same thing to ErinRigh just a few weeks ago. See my post HERE for more info where I show how to code a CUSTOM ability not a CLASS Ability. Sorry about that...
The only thing I notice that is strange is that your script above needs someone to activate it on the In-Play tab to get the bonus. Is that what you want? 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. |
#9 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Quote:
Yes, the activation was intentional, but thanks for checking. |
|
#10 |
|
|