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
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old June 8th, 2010, 01:49 PM
So I managed to work out a work around that lets the user specify what level they took Nymph's kiss. What I am trying to do is use a foreach find every class thing with an index equal or higher, then transition from there to the class helper and add 1 skill point. How can I do this?
Lawful_g is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old June 8th, 2010, 02:26 PM
I believe this problem is one that's more my department, rather than making you figure it out.

Unfortunately, if you simply modify the cSkills field on the class, that will change the skill points of all the class levels, not just the levels at or above the point you want.

Code:
~search through all the class levels
foreach pick in hero from BaseClass
  ~for each class level that's at or above the level we've chosen
  if (field[cLvlIndex].value >= field[hUsed].value) then
    ~retrieve the cClsIndex from the class helper, and use that to figure
    ~out which arrayvalue of the skill totals array to add a bonus to
 
    ~we'll add +1, since this will repeat once for every class level
    herofield[tSkTotals].arrayvalue[eachpick.linkage[helper].field[cClsIndex].value] += 1
 
    ~if the feat was taken at level 1, and we're modifying the class level
    ~at level 1, add another 3 skill points, so that we've added +4 total
    ~for this level
    if (field[hUsed].value= 1) then
      if (field[cLvlIndex].value = 1) then
        herofield[tSkTotals].arrayvalue[eachpick.linkage[helper].field[cClsIndex].value] += 3
        endif
      endif
    endif
  nexteach
If you used something other than field[hUsed].value to allow the user to set the level the feat was taken, you'll want to find those two references and replace them.

Alright, now to try to explain that.

herofield[tSkTotals] is the array that stores the total skill points available you see at the top of each column on the skills tab.

field[cClsIndex].value is the left-right position of each class helper in that array. So,

Code:
eachpick.linkage[helper].field[cClsIndex].value
will transition from the class level to its helper, and get the index for that helper. That's inside

Code:
 
herofield[tSkTotals].arrayvalue[]
so the index that's calculated is the index to add this extra skill point to.
Mathias is offline   #2 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old June 8th, 2010, 03:42 PM
Thanks, that fixed it after a little tweak (had to put "each." in front of "field[cLvlIndex].value")

If you are curious, the way I checked for level was to create 20 invisible specials with a user tag (PickLevel) and each with a tag specific to them (Level1, Level2, etc).

On the feat I have the selection limited to things with the User.Picklevel tag, and an eval script that forwards the Level? tag for the selected invisible special to the hero. A second eval script says "if this tag, then this level" which is used in subsequent calculations...

I actually did this first for the exalted bonus feats for Vow of Poverty, but thought it would work well for Nymph's kiss as well.

And now that it is done, I have Book of Exalted Deeds feats finished.
Lawful_g is offline   #3 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 02:57 AM.


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