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)
-   -   Creating custom ability that scales with level (http://forums.wolflair.com/showthread.php?t=59670)

Bob G December 1st, 2017 08:59 PM

Creating custom ability that scales with level
 
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.

ErinRigh 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

ShadowChemosh 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. :)

ErinRigh December 1st, 2017 10:49 PM

Quote:

Originally Posted by ShadowChemosh (Post 259672)
I recommend reading THIS post I did where I break down the Generic Class Ability Script logic.

Yes this too

Bob G December 2nd, 2017 05:28 AM

Quote:

Originally Posted by ShadowChemosh (Post 259672)
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?

ShadowChemosh December 2nd, 2017 07:58 AM

1 Attachment(s)
Quote:

Originally Posted by Bob G (Post 259684)
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:
Attachment 5690

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]


Bob G 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 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.

ShadowChemosh 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?

Bob G December 4th, 2017 03:37 AM

Quote:

Originally Posted by ShadowChemosh (Post 259786)
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.:)


All times are GMT -8. The time now is 01:44 AM.

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