Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
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 |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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 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[] Code:
round(bonus/3,0,-1) Code:
round(bonus/3,0,-1) + 1 Code:
var bonus as number bonus = #totallevelcount[] field[cfgMax1].value += round(bonus/3,0,-1) + 1 |
#2 |
Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
Thank you very much!!! Works Great!!!
|
#3 |
|
|