• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Class skill code... need some help

I have a piece of code in my classes, that give maximum ranks equal to that of a cross-class skill at the cost of class skills. I copied it mainly from the Guerrilla Scout class in the custom files. However, this code works for the hero, regardless of the class, while I would like it to work specifically in the class it is in. Any suggestions on how to modify this?

~ General skills from cross-class, set out number of ranks
~ equal to our number of points spent.
foreach pick in hero from BaseSkill where "thingid.kListen|thingid.kSpeakLang|thingid.kSpot"
each.field[kUserRanks].value = each.field[kUserPts].value
nexteach

Each pick in hero isn't working here, is there a way to iterate just through the class itself, such as each pick in a class?
 
It may not be possible. Max skill ranks are based on "character level" not "class level" so presumably Hero Labs is built on that. Having said that, its possible I don't fully understand what you're trying to do.
 
It may not be possible. Max skill ranks are based on "character level" not "class level" so presumably Hero Labs is built on that. Having said that, its possible I don't fully understand what you're trying to do.

I don't understand what he is trying to do.
So I don't know how to help.

Kendall, could you give us an example say from a 4th level PC using this benefit and how it would work with and with out the benefit?
 
The example code shown above provides a Wizard with Spot, Speak Languages, and Listen as cross-class skills that can be bought at the class skill rate. In other words, a Wizard's max ranks here are at the cross-class limit, but the cost to buy those skills cost only 1 skill point for 1 rank.

As that stands, this works perfectly. So a 4th level Wizard can buy 3 ranks in Spot, Speak Languages, or Listen (his cross-class maximum) but only spend 3 skill points to get the 3 ranks. So that works. The rub is, say, I want to take a level in Fighter, now the fighter has some of his cross-class skills to do the same. However, Speak Languages should be bought by the Fighter strictly as a cross-class skill (2 skill points = 1 rank), but since the Wizard code applies across the hero, the Fighter is able to still buy the ranks in Fighter just like a Wizard does. I need to make it so that the Fighter is back to buying that strictly as a cross-class skill.

So, in other words, I need to be able to indicate to this script when I am in the specified class so that I know all skill purchases in said class that the code segment applies to are not being applied across the hero (and thus to other classes). The code "for each pick in hero..." would work much better if it was something like "for each pick in <current class> ..." where <current class> is the class using its skill points. If the <current class> applies to the code segment, otherwise it doesn't. That way, I can keep the code in one class from applying across the hero (and thusly to all other classes).

I'm not sure that is clear enough, since the concept doesn't exist outside of my own game. I my game, I have house ruled that certain skills are general skills to certain classes. Wizards have Listen, Speak Languages, and Spot as general skills (cost of class skill, maximum ranks of a cross-class skill). If this is not clear enough, I will try to submit a specific example later. Just let me know.
 
indicate to this script when I am in the specified class so that I know all skill purchases in said class that the code segment

There is no record of when skill points where purchased and which class they belong, so there is no way to code this.

You can however code that loop that when it gets to a skill, it can detect how many levels in the class that grants 1 for 1 and only convert a number of skill points equal to that class's level.

The only other option is to make a tracker, and instead of buying ranks in the Skill tab you buy ranks in the tracker. Then a script in the tracker deducts that number of skill points from the points available and adds that number to the skill in question.
 
You can however code that loop that when it gets to a skill, it can detect how many levels in the class that grants 1 for 1 and only convert a number of skill points equal to that class's level..

This is what I did originally, well something like it anyhow, but I really liked this code segment, seemed elegant, but of course, the across hero is a problem. Ah well, I'll try working on it some more, as I always believe with a little application, there is a way to do what you want (within the constraints of the program). I may just have to go back to my original way of doing it.
 
I'm not at home, so I don't have any way to test this just yet. But, I wonder if this would work, since each code segment occupies a specific class. For example, would this work only for the Wizard?

foreach pick in hero from Class where "thingid.cWizard"
foreach pick in hero from BaseSkill where "thingid.kListen|thingid.kSpeakLang|thingid.kS pot"
each.field[kUserRanks].value = each.field[kUserPts].value
nexteach
nexteach

I wonder if that would keep other classes from accessing this skill code segment?

Hmmm... that might have to be cHelpWiz. I'll try it later when I get home.
 
foreach pick in hero from Class where "thingid.cWizard"

That won't work, but there is a way. I've spent so much time on Pathfinder lately I'd forgotten that HL does record class by class ranks.

Develop->Floating->Show Selection Fields->Concentration.
Add 2 ranks in Concentration on the first class you have.
Notice kValue0 increases.

Notice only 6 classes are possible (which makes me wonder if you are prohibited from adding a 7th class, but that is another thread matter.)

Look up tClass0 to tClass5 searching for your class on the hero.
Then grab kValueX on the skill
There you have how many ranks were bought from that class.
 
The number of ranks bought is not the problem (I'm not changing the cross-class or class skill maximum ranks structure). They difficulty is in how many skill points each class spends on cross-class skills. So, in the previous example, Speak Language is a cross-class skill for a Wizard, and it remains so, it just cost 1 skill point to gain 1 rank in it. Now when I change levels to Fighter, the Fighter also has Speak Language as a cross-class skill, but he should be purchasing the skill points to ranks at a 2 to 1 buy. But because Wizard has code that applies across the hero, the Fighter can buy it at 1 to 1, which I don't want to happen. So I'd have to limit the access to the code across the hero. What you proposed though, still has a solution within it, I just have to think through how to implement it, if its possible at all even. I'll have to look at which class is currently using its skill points (I think it is kUsed0 through kUsed6 or something like that).

Of course, I'm working from memory here, as I don't have HL in front of me.
 
Last edited:
The number of ranks bought is not the problem (I'm not changing the cross-class or class skill maximum ranks structure). They difficulty is in how many skill points each class spends on cross-class skills.

Ok, I guess I had trouble explaining my proposed solution to you. I will try again.

Try this:
1) Look up the class number of points spent on the class you wish to "double" points spent to accomplish 1 for 1.
2) Add the required amount to ranks to make sure they reflect as you wish.
 
This is not actual code, just design and actual code mixed in.

Example code:
Code:
var a as number

search to find the kValue for the class you want to change (kListen) (say 3 = 3rd class you have taken)
a = blah.field[kValue3].value
hero.child[kListen].field[kUserRanks].value += a

Repease last 3 lines for thingid.kSpeakLang|thingid.kSpot"
 
Did some searching:

var index as number
index = hero.child[cHelpWiz].field[cClsIndex].value

that tells you which one it is, so:

if (index = 0) then kValue0
...
if (index = 5) then kValue5
 
Well, I was able to get around this, as long as I'm careful when creating a character. All I have to do is check that there are no remaining skill points in the class that gets the general skills in my game, and only apply the code segment while there are points to be spent. Obviously, I need to spend for each class independently before adding new classes, that's the careful part. Here is what I added to the code segment (using Wizard again).

var index as number
index = hero.child[cHelpWiz].field[cClsIndex].value

if (hero.child[Totals].field[tSkTotals].arrayvalue[index] <> 0) then

*code above*

endif

EDIT: Nevermind, still needs work, forgot it changes the ranks as soon as the skill points are empty. Ergh.
 
Last edited:
Ok, I went back to my original code for doing this, which works. It just isn't doing validity tests like I would like. But it works, and doesn't cause me the headaches that trying to do things across the hero does. Not the ideal solution, but a solution. Oh and I have to use the eval rules panel and set all these skill types to a class skill, then restrict their ranks. Something like this for Speak Languages on a Wizard.

@valid = 1
doneif (#levelcount[Bard] >= 1)

var genRanks as number
genRanks = (#totallevelcount[] + 3) / 2
if (#skillranks[kSpeakLang] > genRanks) then
@message = "Skill " & hero.child[kSpeakLang].field[name].text & " has too many ranks for a general skill."
@valid = 0
endif

Of course, the problem here is it happens within the class, making error validation on the skill difficult at best. As of now, it does a warning. Now I just have to do the same for all the other skills across the classes.
 
Did some searching:

var index as number
index = hero.child[cHelpWiz].field[cClsIndex].value

that tells you which one it is, so:

if (index = 0) then kValue0
...
if (index = 5) then kValue5

risner, my apologies. I did in fact get this to work just as you said. I was simply approaching it the wrong way. By adding 1/2 the specific classes KValue into the kUserRanks, it produced the results I needed that didn't apply it across the hero. Thank you, thank you, and thank you. What I found out is, the only thing I needed to modify was the kUserRanks, as any other modification to kUserPts, kValueX, or the class/cross-class skills of the class were just too inter-connected to not affect something. When I realized that the only thing tracked by class was in the kValue, and the only thing I needed to modify was the kUserRanks, add 0.5 * that kValue back into the kUserRanks worked like a charm, and without messing up any other classes that are using the same skill as cross-class or class. Thank you once again (this was the one and only thing I couldn't stomach a half measure on).
 
risner, my apologies. I did in fact get this to work just as you said. I was simply approaching it the wrong way. By adding 1/2 the specific classes KValue into the kUserRanks, it produced the results I needed that didn't apply it across the hero. Thank you, thank you, and thank you.

Kendall DM (or any), could you clarify the code you used to "make this work"? As the thread mentions and your determinations, adding a skill is pretty straight forward, but I need to create some that are cross-class, specifically languages that would be more difficult to learn. Using Skills would seem the easiest approach except not knowing how to make them cross-class and thus more difficult to master. I think yours is the solution I am needing.
Thanks for the response in advance
 
Thread Bump.... Still trying to figure this out..any help is appreciated

What exactly are you trying to accomplish? If you want what Kendall did, then the script he posted above looks like an eval rule:

Code:
@valid = 1
doneif (#levelcount[Bard] >= 1)

var genRanks as number
genRanks = (#totallevelcount[] + 3) / 2
if (#skillranks[kSpeakLang] > genRanks) then
@message = "Skill " & hero.child[kSpeakLang].field[name].text & " has too many ranks for a general skill."
@valid = 0
endif

PS. If you just want a new skill to be cross-class, then you don't need to do anything. All skills are cross-class unless a class is assigned that class as a class skill.
 
Last edited:
Sendric, Thanks For Rapid Response.... there was a short between the floor and the keyboard.... :p

When adding more language types (in this case there is a series of gestures and visual markers ) unique to The World of Greyhawk's "Gnarley Rangers" that allow them to mark a trail warning of dangers or things nearby. As this is only learnable from a specific type of Ranger I wanted to set the degree of difficulty up a notch.

BUTTTTT I had forgotten that when setting up other campaign specific languages to show as selections on the Personal tab, I had duplicated the list in both the languages and skills tabs in the editor user file. I was adding this particular "secret language" on the wrong tab oooopppps...

Thanks Again:D
 
Back
Top