Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
Bob G
Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 80

Old December 1st, 2017, 08:59 PM
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.
Bob G is offline   #1 Reply With Quote
ErinRigh
Senior Member
 
Join Date: Oct 2016
Posts: 564

Old December 1st, 2017, 09:22 PM
The syntax you want for that is;

Code:
#competencebonus[hero.child[skStealth], 1]
You might find this article useful, I sure did

If you are not on a mac you'll find it at;
file:///C:/ProgramData/Hero Lab/data/pathfinder/authoring/pathfindereditwhere.htm
ErinRigh is offline   #2 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,400

Old December 1st, 2017, 09:46 PM
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.
ShadowChemosh is offline   #3 Reply With Quote
ErinRigh
Senior Member
 
Join Date: Oct 2016
Posts: 564

Old December 1st, 2017, 10:49 PM
Quote:
Originally Posted by ShadowChemosh View Post
I recommend reading THIS post I did where I break down the Generic Class Ability Script logic.
Yes this too
ErinRigh is offline   #4 Reply With Quote
Bob G
Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 80

Old December 2nd, 2017, 05:28 AM
Quote:
Originally Posted by ShadowChemosh View Post
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.
Thanks Shadow. I'm still very new to the editor, where do I define Listname and xCount?
Bob G is offline   #5 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,400

Old December 2nd, 2017, 07:58 AM
Quote:
Originally Posted by Bob G View Post
Thanks Shadow. I'm still very new to the editor, where do I define Listname and xCount?
You don't.

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.
ShadowChemosh is offline   #6 Reply With Quote
Bob G
Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 80

Old December 2nd, 2017, 12:37 PM
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.
Bob G is offline   #7 Reply With Quote
Bob G
Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 80

Old December 3rd, 2017, 03:26 PM
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.
Bob G is offline   #8 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,400

Old December 3rd, 2017, 09:04 PM
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.
ShadowChemosh is offline   #9 Reply With Quote
Bob G
Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 80

Old December 4th, 2017, 03:37 AM
Quote:
Originally Posted by ShadowChemosh View Post
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?
No worries sir, I almost always type the wrong term initially. I have to edit myself very carefully because all these terms are new to me.

Yes, the activation was intentional, but thanks for checking.
Bob G is offline   #10 Reply With Quote
Reply

Thread Tools
Display Modes

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 04:17 PM.


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