• 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

How to transfer from a Class thing to it's Helper?

Lawful_g

Well-known member
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?
 
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.
 
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.
 
Back
Top