Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
The v1.8 Pathfinder files include the ability to create classes in the editor, so I'm adding a quick explanation of something I didn't have time to add to the documentation.
The way class specials are used in the Pathfinder files differs from the way they are used in the SRD files. In the SRD files, the Sneak Attack ability was defined separately for each class, and for each +1d6 a class gave you, a different copy was required - each copy specified the level it was gained at. The initial copy on each class calculated the number of class levels you had, and calculated the number of d6's that you had gained. Each initial copy also bootstrapped another sneak attack thing from the Special category - because this thing was unique, no matter how many classes with sneak attack you had, only one copy could ever be added. That way, each class could add its bonus to that common thing, which displayed the total. In Pathfinder, the Sneak Attack ability is defined only once. Each class adds as many copies of Sneak Attack as it needs, telling each copy what level it is gained at. The program searches through all the copies of sneak attack that have been added to the hero. It designates one of them as being the primary copy (this will be the lowest-level copy on the class who'se first level is the lowest). Then the primary copy simply counts the number of copies whose level has been reached, and displays that total to the user. On the class, you'll add all your class specials with the "Class Specials" button in the editor, as you did for the d20 system. However, there's an extra step, since the Pathfinder versions aren't level specific. Go to the bootstraps button on the top left of the editor. In there, you'll see a list of all the class specials you've added (along with other bootstraps like the weapon/armor proficiencies). For each one, press the "Tags" button, then "Add another tag", and then in the "Group Id" field, enter "ClSpecWhen" - capitalization is important. In the "Tag Id" field, enter the level the class gets this special at. If a class gets the same special at multiple levels, press "Click to add another bootstrap", enter the name of the class special, then set the level by adding a ClSpecWhen tag. Do that for each additional copy, giving each one the appropriate level. Let's use sneak attack's script as our example: Code:
field[abValue].value += field[xCount].value field[livename].text = "Sneak Attack +" & field[abValue].value & "d6" field[abSumm].text = "+" & field[abValue].value & "d6 damage if you flank your target or your target is flat-footed." field[listname].text = "Sneak Attack +" & field[xIndex].value & "d6" When writing a script, X += Y means the same thing as X = X + Y - it just saves a bit of writing. In this case, it means we're adding our count to whatever was already there, instead of replacing it. Normally, abValue will be 0 until this script is run, but this means that we can make a feat that says "You get +1d6 to your sneak attack damage". All that feat has to do is add 1 to the abValue field of sneak attack (which is simplified with a macro): #value[cSneakAtt] += 1 So, all that feat needs is a one line script. Just make sure that the timing puts it before Sneak Attack's script runs (which is Post-Levels/10000). Code:
field[livename].text = "Sneak Attack +" & field[abValue].value & "d6" field[abSumm].text = "+" & field[abValue].value & "d6 damage if you flank your target or your target is flat-footed." Each of those lines uses & symbols to mix together text with the abValue we've calculated, to generate the name and summary the user will see. Code:
field[listname].text = "Sneak Attack +" & field[xIndex].value & "d6" (I'm sorry about the length, it takes a lot of words to explain this, but I hope you'll be able to get used to the method once you've tried it a few times). The best way to learn how to use this is probably to look at examples. Go the the class special tab in the editor, and press the "New (Copy)" button Last edited by Mathias; October 9th, 2009 at 07:26 PM. Reason: Added how to set the level on a class special |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
As a second example, we'll pick something that's more level based, rather than count-based - the Wild Empathy ability. The same class special is shared between Druids and Rangers.
The Wild Empathy ability has two simple scripts, instead of the more complex single script that Sneak Attack uses. The first runs at Post-Attributes/10000: Code:
field[abValue].value = field[xAllLev].value + hero.child[aCHA].field[aModBonus].value The second script generates the name, at Render/1000: Code:
field[livename].text &= " +" & field[abValue].value By the time we've gotten to Render/1000, we're inside a window. At Final/100, if nothing has been set for the livename yet, the livename is set equal to the name. At Render/500, any information from things the user has selected (for example, the weapon selected for weapon focus) is added to the livename. The other end of the window is at Render/20000, when the DC and the ability type ((Su) for example) are added to the livename. So, inbetween Render/500 and Render/20000, you can use: Code:
field[livename].text &= |
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
As a note, you may see the field xTotalLev used in place of xAllLev in some scripts. xAllLev is the total levels of all the classes which have the same class specials (oh - and it does make sure that you've reached the correct level before adding in those xAllLev's). xTotalLev is the total level of the class that this special is on. So, for a Druid 5/Ranger 3, Wild Empathy would have an xAllLev of 8. The Druid's copy would have an xTotalLev of 5, and the Ranger's copy would have an xTotalLev of 3.
In most cases, class specials aren't shared though - why use xAllLev? The reason is that someone might write a prestige class or a regular class in a year that does share that special. When that happens, if you've used xAllLev, they'll merge together nicely. On the other hand, if you know you don't want your specials to merge if they're on multiple classes, use xTotalLev instead. |
#3 |
|
|