lazarus wrote:
>
>
> Having just tried the Deverenian with your script as is, I have to
> apologize ... obviously I just didn't know what was going on. It works
> like that.
Sorry, I was unclear. I'll go over the different bits in more detail.
~ Iterate through all class levels
foreach pick in hero where "component.BaseClass"
This iterates through all the class levels in the hero. For example, if
you have 2 levels of fighter and 3 levels of Rogue, the following will
run 5 times.
~ Get the index of this level within the list of class levels.
index = each.field[cIndex].value
So your first class level would be index 1, your second would be index
2, etc.
~ If the index is odd, we want to add 2 skill points.
~ Otherwise, 0.
if (index % 2 = 1) then
points = 2
else
points = 0
endif
Nothing hard here - just working out whether this level gets 0 skill
points or 2 skill points.
~ Get the index of this class's skill point totals
~ in the list of classes.
classindex = each.linkage[helper].field[cClsIndex].value
Each class has an index. For example, if we're a fighter 2 / rogue 3,
fighter might be our first class, and rogue might be our second class.
This is done so that we can keep track of how many skill points each
class is allowed.
~ Add the skill points to the class total.
hero.child[Totals].field[tSkTotals].arrayvalue[classindex] += points
Now we know the index of the class, add the right number of skill points.
nexteach
We're done - go on to the next pick.
> is it using anything I may have to update on dataset updates?
I'm not sure what you mean by this?
Hope this helps,
--
Colen McAlister,
colen@wolflair.com
Chief Engineer, Lone Wolf Development