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
Frodie
Senior Member
 
Join Date: May 2007
Location: Durham, NC
Posts: 1,747

Old December 16th, 2010, 09:50 AM
Ok, what I am trying to do is give xyz Template a choice of a Special Ability 1 at first level and then again every 3 levels starting at 3rd level, (i.e. Special Ability gained at level 1,3,6,9,12,15,18)

Here is the script I copied from the Ghost, but it doesn't seem to work:


~we get a Aware Power for every 3 CR we have, minimum 1
field[cfgMax1].value += maximum(round(herofield[tCR].value/3,0,-1),1) - 1
Frodie is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old December 16th, 2010, 10:31 AM
Let's pull apart the ghost's code (here's the whole thing, since there are notes in the comments that are useful):


Code:
      ~we get a ghost ability for every 3 CR we have, minimum 1
      ~the first ability slot is always spent on Corrupting Touch, so that's a permanent bootstrap
      ~and not included in this list
      field[cfgMax1].value += maximum(round(herofield[tCR].value/3,0,-1),1) - 1
It talks about removing the first ability slot, because Corrupting Touch is added to all Ghosts (so effectively, Corrupting Touch is a permanent power, and ghosts gain their first power at CR 6) - so, that's the -1 at the end - you can just drop that.

The next thing is a maximum(X, 1) - that's because even at CR 1, the ghost gets an ability. It looks like instead of a minimum of 1 ability, you want to add 1/3 levels, +1.

The next thing is the round(X,0,-1) - round X to 0 decimal places, -1 means down. You want to keep this.

The next thing is herofield[tCR].value - that't the CR of the character. Looking through the Reference Information page of the editor manual, the second macro described is #totallevelcount[] - which returns the level of the character.

Since I've had trouble using macros inside other expressions, it's best to make sure it'll be interpreted correctly by calling the macro by itself:

Code:
 
var bonus as number
bonus = #totallevelcount[]
Then, you'll want to divide that by 3 and round it down to the nearest whole number:

Code:
 
round(bonus/3,0,-1)
You'll add the ability gained at 1st level:

Code:
 
round(bonus/3,0,-1) + 1
Assembling it all:
Code:
 
var bonus as number
bonus = #totallevelcount[]
field[cfgMax1].value += round(bonus/3,0,-1) + 1
Also, remember to check the Phase and Priority you're running this at - the default for a new script is First/100, which is much too early - since you need to know the Level of the character, you'll want to be in the Post-Levels phase.
Mathias is offline   #2 Reply With Quote
Frodie
Senior Member
 
Join Date: May 2007
Location: Durham, NC
Posts: 1,747

Old December 16th, 2010, 10:38 AM
Thank you very much!!! Works Great!!!
Frodie is offline   #3 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 09:12 PM.


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