Control
Control was the trickiest part. D&D doesn't have an equivalent, so I had to experiment with ways to handle it. First I found that it was possible to make a new panel with my own data file. With some fiddling, I got it to display a level number and die type with racial modifier. This was far from ideal, but for a long time it was my solution. I couldn't expand the BaseClass component, which is what control would optimally be part of.
Races would assign a tag from the cRaceMod group (valid values 0-3, 0 being treated as -1). Class levels would have a tag from the cDieType group (valid values 6, 8, and 12).
Eventually I stumbled on to the root access functionality (this.root.field[example].value). With that, as long as my control data was bootstrapped to a class level, I could access the class level's data. With a little testing, I got the class name onto the output with the level number and control die type. A thing called ControlVal had to be bootstrapped to every class level thing, and Helper.FixedHP had to be assigned if applicable (Control rolls should probably be max whenever HP is).
With that, I expanded my control component to contain an incrementer and calculated value. It also checks the entered number against the die type, as well as a 0 value.
The final step was getting the total. I needed a new thing on the control panel, and I needed it there all the time, or it would throw errors. I replaced Charisma with my own version that had my ControlTot thing bootstrapped. Hero Lab would then add this at character creation.
Class Defense
This is the only thing I have set as a house rule in the core files. Farscape gave you an average of your multiclass defense bonuses. Having played Star Wars d20, I adopted their rule of -2 to each additional class (which translates into a +2 bonus at first level, essentially). The commented procedure is below.
Code:
<procedure id="clsdefense" scripttype="eval"><![CDATA[
~ Armor replaces class defense bonus.
doneif (hero.tagcount[Hero.EquipArmor] <> 0)
var defense as number
~ According to Farscape, there's actually supposed to be an average of the bonuses.
~ I found that too penalizing, so I borrowed from Star Wars d20 (-2 penalty for additional base classes.
~ In hero lab terms, I gave a +2 to the first level chosen.
if (this.tagcount[Helper.FirstLevel] <> 0) then
defense = 2
else
defense = 0
endif
if (this.tagcount[User.DefGood] <> 0) then
if (this.field[cThisIndex].value = 1) then
defense += 2
elseif (this.field[cThisIndex].value = 2) then
defense += 1
elseif (this.field[cThisIndex].value = 4) then
defense += 1
elseif (this.field[cThisIndex].value = 6) then
defense += 1
elseif (this.field[cThisIndex].value = 8) then
defense += 1
elseif (this.field[cThisIndex].value = 10) then
defense += 1
elseif (this.field[cThisIndex].value = 12) then
defense += 1
elseif (this.field[cThisIndex].value = 14) then
defense += 1
elseif (this.field[cThisIndex].value = 16) then
defense += 1
elseif (this.field[cThisIndex].value = 18) then
defense += 1
elseif (this.field[cThisIndex].value = 20) then
defense += 1
endif
elseif (this.tagcount[User.DefMedium] <> 0) then
if (this.field[cThisIndex].value = 1) then
defense += 1
elseif (this.field[cThisIndex].value = 2) then
defense += 1
elseif (this.field[cThisIndex].value = 5) then
defense += 1
elseif (this.field[cThisIndex].value = 7) then
defense += 1
elseif (this.field[cThisIndex].value = 10) then
defense += 1
elseif (this.field[cThisIndex].value = 12) then
defense += 1
elseif (this.field[cThisIndex].value = 15) then
defense += 1
elseif (this.field[cThisIndex].value = 17) then
defense += 1
elseif (this.field[cThisIndex].value = 20) then
defense += 1
endif
elseif (this.tagcount[User.DefPoor] <> 0) then
if (this.field[cThisIndex].value = 3) then
defense += 1
elseif (this.field[cThisIndex].value = 6) then
defense += 1
elseif (this.field[cThisIndex].value = 9) then
defense += 1
elseif (this.field[cThisIndex].value = 12) then
defense += 1
elseif (this.field[cThisIndex].value = 15) then
defense += 1
elseif (this.field[cThisIndex].value = 18) then
defense += 1
endif
endif
~ There isn't a field for class defense bonus, so I put it in Misc.
hero.child[ArmorClass].field[tACMisc].value += defense
]]></procedure>
Racial HP
According to the Farscape rules, your hit die comes from your race, not your class. Class gives a modifier, so the total calculation is racedie + classmod + conmod. I created a tag group called cRaceHP, with minimum and maximum values of 8 and 12. These are assigned to the race, and forwarded to the hero. A procedure, detailed below, is called by the class helper.
Code:
var hp as number
call racialhp
this.field[cHDSides].value = hp
<procedure id="racialhp" scripttype="eval"><![CDATA[
var hp as number
if (hero.tagvalue[cRaceHP.?] <> 0) then
hp = hero.tagvalue[cRaceHP.?]
else
hp = 1
endif
]]></procedure>
Backgrounds
Backgrounds are chosen at first level, and give certain benefits based on what the hero has done in the past. They are bought with skill points. A character may pick up to two backgrounds.
I set them up as skills. Each background has an eval script that deletes Helper.SklErRanks (many cost more than 4 ranks), and assigns User.Background to the hero. If there are more than two User.Background tags, it throws an error.
The eval rule checks if the hero qualifies for a discounted purchase (most are cheaper for some classes), and how many ranks are put into it. If the number of ranks is equal to the cost of the skill, it is valid.
I think that's all of the major wrinkles I went through with the files.