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
DannyBoy2k
Senior Member
 
Join Date: Jul 2005
Posts: 181

Old May 14th, 2013, 12:57 PM
That would be LOVELY.

-------------
By Lenin's Beard Gel!
DannyBoy2k is offline   #11 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old May 14th, 2013, 01:37 PM
Alright, I found the issue on our end. It looks like in the calculation script we used a variable "bonus" which had already been used earlier and we forgot to remove the value from it's previous use. This it was always adding the value of the cPsiLevMax field if there were no bonus power points from your attribute.

Here's the offending bit of code, along with the debug statements I used to track the issue down:
Code:
      field[cPsiLevMax].value = bonus

      ~ If we have a link to an attribute for bonus power points, get the
      ~ attribute bonus now so we can calculate how many bonus PP we get.
      var bonus as number
      var attrbonus as number
      if (tagis[PsiAttr.?] <> 0) then
debug "We have the tag"
        var searchexpr as string
        searchexpr = tagids[PsiAttr.?,"|"]
        attrbonus = hero.findchild[BaseAttr,searchexpr].field[aModBonus].value
      elseif (islinkage[psiattr] <> 0) then
debug "We have the linkage"
        attrbonus = linkage[psiattr].field[aModBonus].value
        endif

      ~ Our bonus PP = (attribute bonus * level) / 2, rounded down
      if (attrbonus > 0) then
debug "attrbonus is " & attrbonus
        bonus = (attrbonus * level) / 2
        bonus = round(bonus, 0, -1)
debug "bonus is " & bonus
        endif

      ~ Add our bonus power points to the maximum we have at this level
debug "bonus is " & bonus
debug "before add bonus, cPsiPPMax is " & field[cPsiPPMax].value

      field[cPsiPPMax].value = field[cPsiPPMax].value + bonus

debug "after add bonus, cPsiPPMax is " & field[cPsiPPMax].value
So, to compensate for this error, you should make an eval script which foreaches through the psionic classes, checks their associated attribute bonus, if it is 0, then subtract that class' maximum psionic power level from the PP point total. Since d20 doesn't have mechanics, you'll have to put it on something else added to all heroes, like a condition (I believe there is a Hasted condition in the Community files which will serve).

Here's the script I used:

PostAttr 11000
Code:
    var attrbonus as number

    foreach pick in hero from BaseClHelp where "Helper.Manifester"
      attrbonus = eachpick.linkage[psiattr].field[aModBonus].value

      if (attrbonus = 0) then
        ~ This part undoes the error on the total power points.
        hero.child[Psionics].field[tPPTotal].value -= eachpick.field[cPsiLevMax].value

        ~ It's too late to stop the points from being forwarded from this class, but this part at least fixes the display on our class tab.
        eachpick.field[cPsiPPMax].value -= eachpick.field[cPsiLevMax].value
        endif
      nexteach
I tested it a little bit, but not extensively. Tell me if you need help refining it.

Last edited by Aaron; May 14th, 2013 at 01:39 PM.
Aaron is offline   #12 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old May 15th, 2013, 04:47 AM
Quote:
Originally Posted by Aaron View Post
Here's the script I used:

PostAttr 11000
Code:
    var attrbonus as number

    foreach pick in hero from BaseClHelp where "Helper.Manifester"
      attrbonus = eachpick.linkage[psiattr].field[aModBonus].value

      if (attrbonus = 0) then
        ~ This part undoes the error on the total power points.
        hero.child[Psionics].field[tPPTotal].value -= eachpick.field[cPsiLevMax].value

        ~ It's too late to stop the points from being forwarded from this class, but this part at least fixes the display on our class tab.
        eachpick.field[cPsiPPMax].value -= eachpick.field[cPsiLevMax].value
        endif
      nexteach
I tested it a little bit, but not extensively. Tell me if you need help refining it.
Awesome. Thanks so much, Aaron. This was driving me nuts! I'll add it to the next community release. The only tweak I will have to make is that it needs to be "attrbonus <= 0" since this issue occurs when the bonus is negative too (though I'd like to think most players wouldn't build their characters like that).
Sendric is offline   #13 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 03:36 PM.


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