Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,322

Old March 27th, 2009, 06:12 AM
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.
chiefweasel is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old March 27th, 2009, 07:09 AM
you have a ( where a [ should be before the second kBluff.

I also recommend:
#skillbonus[kBluff] += X
as being a lot faster to write.
Mathias is offline   #2 Reply With Quote
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,322

Old March 27th, 2009, 02:26 PM
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.
chiefweasel is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old March 27th, 2009, 03:48 PM
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.
Mathias is offline   #4 Reply With Quote
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,322

Old March 27th, 2009, 05:27 PM
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
chiefweasel is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old March 28th, 2009, 07:09 AM
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?
Mathias is offline   #6 Reply With Quote
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,322

Old March 28th, 2009, 04:16 PM
says Phase:first
Priority: 100
Index: 1
chiefweasel is offline   #7 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old March 28th, 2009, 06:36 PM
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).
Mathias is offline   #8 Reply With Quote
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,322

Old March 28th, 2009, 07:16 PM
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 by chiefweasel; March 28th, 2009 at 07:59 PM.
chiefweasel is offline   #9 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old March 29th, 2009, 10:04 AM
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?
Mathias is offline   #10 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:04 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.