PDA

View Full Version : Changing the Language Rules


Drew
July 28th, 2010, 09:01 PM
I just downloaded Hero Lab and I'm looking to implement some house rules. The first thing I want to do is change the way Linguistics grants languages. Basically, I want characters to learn 1 language for every 2 points they put into Linguistics, instead of 1 for 1. I understand that I can do this by creating a new Linguistics skill that uses the same ID as the original skill. I created a duplicate of Linguistics to get started, but the script part where it actually generates the number of languages is completely foreign to me. Can some one give me quick instructions on how to change this to give the effect I want?

Also, how do I get the program to stop displaying the default languages and only display my own, campaign specific languages?

Thanks in advance.

TopCat
July 29th, 2010, 02:40 AM
The script in the Linguistics skill currently reads:

container.child[Totals].field[tLangsSpk].value +=
field[skUser].value + field [skInnate].value

This is telling Hero Lab to add a number of languages to the character equal to the number of ranks put into Linguistics (the field[skUser].value bit). I'm not sure what the skInnate bit is doing but we can ignore that for the purposes of this script.

If all you want to do is add one language per 2 skill points, then change the script to

container.child[Totals].field[tLangsSpk].value +=
round(field[skUser].value / 2, 0, -1) + field [skInnate].value

All that's doing is dividing the skill ranks by two and rounding down any fractions.

It's easy enough to add in your own languages via the editor. Where they replace an existing language, you can just use the "Replaces Thing Id" field in the same way as you did for your copy of the Linguistics skill.

Hiding/disabling the remaining languages can be done using the "Hidden" tab in the editor (create a new entry, enter the language Id and it should vanish). It's problematic to do that, though, as many races may well depend on that language being available and could start throwing errors at you within Hero Lab. The simpler solution may be to override the languages you don't want with dummy languages that are clearly named not to be used.

Mathias
July 29th, 2010, 06:55 AM
Thanks for answering this, TopCat. To clarify, if a race pre-sets how it spends its skill ranks, that's done with skInnate, so skUser and skInnate should be totaled before dividing by two:


var bonus as number
bonus = field[skUser].value + field[skInnate].value
container.child[Totals].field[tLangsSpk].value += round(bonus/2,0,-1)

Drew
July 29th, 2010, 12:39 PM
Wow, what a rapid response! Thanks a bunch.

Drew
August 16th, 2010, 08:58 PM
Thanks for answering this, TopCat. To clarify, if a race pre-sets how it spends its skill ranks, that's done with skInnate, so skUser and skInnate should be totaled before dividing by two:


var bonus as number
bonus = field[skUser].value + field[skInnate].value
container.child[Totals].field[tLangsSpk].value += round(bonus/2,0,-1)


Hey, Mathias, can you clarify this a bit? I'm not sure I understand...

Actually, I'm trying to redo this since I added the APG. Now I'm getting the following error when I try to test the data after making the changes TopCat suggested:

"Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'eval' script for Thing 'SkLing' (Eval Script '#2') on line 1
->invalid use of a reserved word in script"


Um...what?

Mathias
August 17th, 2010, 06:57 AM
"invalid use of a reserved word in script " almost always means a spelling error in my experience (by misspelling something, you created an instruction that's not in its approved list).

If you copied TopCat's script directly, try removing the space within "field [skInnate].value"

Could you copy the script you've added to your thing and paste it here for me to look at? (The error says Eval Script #2, so please copy both scripts).

Drew
August 17th, 2010, 06:41 PM
"invalid use of a reserved word in script " almost always means a spelling error in my experience (by misspelling something, you created an instruction that's not in its approved list).

If you copied TopCat's script directly, try removing the space within "field [skInnate].value"

Could you copy the script you've added to your thing and paste it here for me to look at? (The error says Eval Script #2, so please copy both scripts).

Indeed, the problem was the space as you thought. I removed it and things are now working again. Thanks for your help.

Mathias
August 17th, 2010, 08:51 PM
Just as a note, my script was intended as a correction of TopCat's, not an addition, so I wouldn't recommend using both scripts together (or they'll stack and each add 1/2 language / slot, meaning that at 1 rank, you'll get 0 languages, 2 languages at 2, 2 at 3, 4 at 4, etc).