• 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

Adding a Class level to a Skill

chiefweasel

Well-known member
I am trying to create a Kensai and at 4th level he get the ability, Ki Projection. This allows him to add 1/2 his level to several skills. This changes to equal his level at level 8. I thought I had the code, but I was wrong. here is what I did:

~ Add our level + 1 / 2 to skills.
var X as number
X = (field[xTotalLev].value + 1) / 2
X = round(X, 0, -1)

hero.child[kBluff].field[Value].value = hero.child(kBluff].field[Value].value + X

For some reason the system cant understand the last line. Anyone have any suggestions? Thanks.
 
you have a ( where a [ should be before the second kBluff.

I also recommend:
#skillbonus[kBluff] += X
as being a lot faster to write.
 
I must be doing something wrong, here is the code I have:

var X as number
X = (field[xTotalLev].value + 1) / 2
X = round(X, 0, -1)

#skillbonus[kBluff] += X

but it is not making any changes to the Bluff skill, or any changes to anything that I can see. I know that the level is wrong, I need to determine the level of the pretige class I am using and not the level of the character. I can work on that when I get this done.
 
if you're running that script from within a class special, then field[xTotalLev].value should be the class level, not the character level. Actually, if you weren't running it from within a class special, you would have gotten a compile error, since that field is only defined for class specials.

What phase are you running it in? Since xTotalLev is set either in the Levels or Post-Levels phase, and skills are in the Post-Attributes, I recommend User Pre-Attributes for a script that needs a class level and uses it to modify a skill.
 
Am running the script from the Class Special tab, using the Eval Scripts option. The script does compile Ok, just doesnt seem to do anything. lol
 
So in the eval script window, it will have a selector at the top for you to select the phase the script runs in, and a field for you to enter the priority the script runs at. What are those values?
 
In the first phase, xTotalLev hasn't been set yet, so it's still equal to 0. Try Phase: User Post-Levels, with the same priority (index isn't something you need to worry about - the editor will automatically assign a different index to each eval script on the same thing).
 
That seems to have done it. Now I need to add it again at 8th level and give = to the kensai level for it. I'll work on that part, I have a few ideas. thanks.

Nope sorry, it was working for a while then stopped. very odd. Now it can't find the class I am working with either. It seems to want to function at 1st level even though I have selected Level Requirement 4. It also doesnt calculate correct. Using a 5th level paladin (with a buff being at 4) and add 1 level of kensai it receives a +2 Bluff bonus (The skill I am working with). I could understand a +3 shift due to 1/2 the total levels, but I dont get the +2 shift. I am using the same code that is listed above.
 
Last edited:
Actually, if it equals 1/2 your level from 4th until 8th level, and your level after that, how about:

Code:
var levels as number
levels = field[xTotalLev].value
if (levels < 4) then
  levels = 0
elseif (levels < 8) then
  levels = field[xTotalLev].value / 2
  levels = round(levels,0,-1)
endif
~If levels is greater or equal to 8, neither of the other conditions will be fulfilled, leaving it still equal to the class level.

A note on how class abilities work: Once you add any levels of a class, ALL the class abilities are added to the character. They're only hidden until the level requirement is met. That's why the ability is triggering for a first level character - the class ability is there, its script is running, so it's adding the bonus. So, you always want to be careful to think about your lower limits when writing your scripts.

The statement I have above will make sure that nothing happens below 4th level.

In terms of that +2, didn't you say you were adding a second copy to handle level 8+? Is it that both are adding the same bonus? It may also have to do with that +1 you're adding to the level before you halve it.

Please elaborate on where your class and ability are missing - missing from the editor, missing fro your test character, missing from the class selection list?
 
The ability doesnt seem to be working in my test character. I see the special in the list, it just doesnt seem to be doing anything.

I do have a question though, if i specify a level requirement of 4, why does it not wait until level 4 to do it? whay would it do anything at level 1?

Using the totatlevel +2 is some code I got from another class, I wondered why it would do that but I am not a programmer so i just used it. I will remove it though and see if that helps.
 
The ability doesnt seem to be working in my test character. I see the special in the list, it just doesnt seem to be doing anything.

I do have a question though, if i specify a level requirement of 4, why does it not wait until level 4 to do it? whay would it do anything at level 1?

Colen and Mathias are the d20 data file experts, so I can't help with getting this to actually work. However, I can explain a bit about how things work internally that should clarify your questions above.

With d20, there is a major distinction between adding a *class* and adding a *class level*. A *class* is only ever added to a character a single time, while a *class level* is added once for every time you take a new level in a given class. As far as HL is concerned, every *class level* is identical. There is no distinction between the first class level and the 9th class level. It's just a pool of class levels that are sequenced.

Because of this, all of the logic regarding class abilities is associated with the *class* - not the class level. If an ability is gained at 4th level, it is added by the *class* and starts out disabled. As soon as the proper number of *class levels* are added to the character, then the ability becomes enabled.

Doing things this way allows you to define all of the logic for all levels of the class in a single place - on the *class* itself. All the *class levels* then unlock facets of the *class* based on the number of class levels added to the character. They also allow the tracking of HP and other stuff on a per-level basis. But that's how they work with respect to abilities.

Hope this explanation helps!
 
I see. Although it still doesnt make sense. I have created a few other prestige classes that required level restrictions and haven't run into this problem before. In those cases just by chosing the level requiremnt from the panel was enough to indicate that the effect occured at that level. Not sure why its different all of a sudden.

All I am really trying to do is determine the class level and add it to a skill at level 4. But the panel doesn't understand what the level requirement is and just applies the change at level 1.

I've been messing with this one for about 4 weeks now and can't seem to make any headway. Any out there have any suggestions?
 
On those other abilities you've created, did they actually have scripts to run, or were they just supposed to display some text? What Rob described is actually happening behind the scenes for a text-only special - it does exist on the character, but because it doesn't have any scripts that change other things, the user doesn't see any evidence that it exists. Because your special with a script always exists once the class is added, the script always runs.
 
Last edited:
Back
Top