Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Valdacil
Senior Member
 
Join Date: Feb 2017
Posts: 119

Old May 5th, 2017, 09:59 AM
I'm back at it again with ABP rules and stacking of ABP bonuses. This time I'm looking at Mental and Physical Prowess stacking with things like Bull's Strength and Cat's Grace. The ABP bonus is being applied as an Enhancement bonus, which is the same as those spells therefore they aren't stacking. I'd like to change it so they do.

However, again I'm bumping up against the inability to alter, or even inspect, the ABPAttune thing. I can see evidence (via selection field history) that it applies the Enhancement bonus to the attribute in question and field history says that is coming from a script on ABPAttune.

So my questions are:
1) Where does it store the information when you select a Mental/Physical Prowess on the Bonus Progression tab? I've been unable to pin down that object.
2) How might I go about altering the bonus applied to be untyped instead of enhancement so that it can stack?

Last edited by Valdacil; May 7th, 2017 at 11:27 AM.
Valdacil is offline   #1 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old May 5th, 2017, 11:02 AM
1) Do you mean, as far as how many you've added of a particular type? Depending on which table it is added to, a script on the pick adds 1 to a certain resource on the hero. resWepAtNm/resArmAtNm/resPhyAtNm/resMenAtNm

2) Well, I think you'd have to foreach through the attunement picks and set their value field to some arbitrarily low negative number (there is already a mechanism to keep them from going negative), then at the same time run similar scripts to what they already have to recalculate the correct bonus and apply it to their pick as an untyped bonus.

Another way to approach it would be to leave them as enhancement bonuses, but change the spell adjustments or items or whatever you're interested in that you do have easier access to, to untyped bonuses.

Here, for your information, I'll post the XML for all the scripts APBAttune runs:

Code:
    <eval index="1" phase="First" priority="10000"><![CDATA[
      ~ Set our Minimum bound.
      if (tagexpr[Helper.AttrPhyAtt | Helper.AttrMenAtt] <> 0) then
        field[abUsrMin].value = 2
      else
        field[abUsrMin].value = 1
        endif

      ~ This is the number of picks we are allowed for each category
      if (tagis[Helper.WepAttune] <> 0) then
        #resspent[resWepAtNm] += 1
      elseif (tagis[Helper.ArmAttune] <> 0) then
        #resspent[resArmAtNm] += 1
      elseif (tagis[Helper.AttrPhyAtt] <> 0) then
        #resspent[resPhyAtNm] += 1
      elseif (tagis[Helper.AttrMenAtt] <> 0) then
        #resspent[resMenAtNm] += 1
        endif

      ~ This is the value of each of the picks.
      ~ Weapon and armor attunements can be split into a primary and secondary grouping
      if (tagis[Helper.WepAttune] <> 0) then
        ~ If nothing has added to the primary resource tracker yet, then we are
        ~ the first, so add to that!
        if (#resspent[resWepPrMx] = 0) then
          #resspent[resWepPrMx] += field[abUserVal].value
        ~ Otherwise, add to the secondary
        else
          #resspent[resWepScMx] += field[abUserVal].value
          endif
      elseif (tagis[Helper.ArmAttune] <> 0) then
        ~ If nothing has added to the primary resource tracker yet, then we are
        ~ the first, so add to that!
        if (#resspent[resArmPrMx] = 0) then
          #resspent[resArmPrMx] += field[abUserVal].value
        ~ Otherwise, add to the secondary
        else
          #resspent[resArmScMx] += field[abUserVal].value
          endif

      ~ For attribute enhancements, we count anything beyond our initial value (2) as an upgrade
      elseif (tagis[Helper.AttrPhyAtt] <> 0) then
        #resspent[resPhyAtUp] += (field[abUserVal].value/2) - 1
      elseif (tagis[Helper.AttrMenAtt] <> 0) then
        #resspent[resMenAtUp] += (field[abUserVal].value/2) - 1
        endif
      ]]></eval>

    <eval index="2" phase="PostLevel" priority="10000" name="Attunements Apply Enhancement Bonuses"><![CDATA[
      field[abValue].value += field[abUserVal].value

      doneif (field[usrChosen1].ischosen = 0)

      perform field[usrChosen1].chosen.setfocus

      ~ Armor attunements can be applied to whatever clothing is worn
      if (field[usrChosen1].chosen.tagis[thingid.selClothin] <> 0) then
        perform hero.child[ArmorClass].setfocus
        endif

      ~ Can't be more than 10. That is the max legendary gifts can bring us to.
      field[abValue].value = minimum(field[abValue].value,10)

      ~ The attunement bonus we apply is offset by any item powers on the target
      ~ item.
      ~ This only applies to weapon/armor attunements
      if (tagexpr[Helper.ArmAttune | Helper.WepAttune] <> 0) then
        if (focus.tagis[component.BaseMagicI] <> 0) then
          field[abValue].value -= focus.field[iPowEqiBon].value
          endif

        ~ We can't have more than 5 enhancement bonus left over to apply to
        ~ attack and damage, regardless of how much was or was not taken up by
        ~ the selection's item powers!
        field[abValue].value = minimum(field[abValue].value,5)
        endif

      ~ Can't be less than 0. Our attunement never makes us take a negative.
      field[abValue].value = maximum(field[abValue].value,0)

      #enhancementbonus[focus, field[abValue].value]

      ~ If this is selecting a mental attribute, and that attribute is Int, then
      ~ there are some other things which accompany permanent increases, like
      ~ bonus skill points and languages
      if (tagis[Helper.AttrMenAtt] <> 0) then
        if (focus.tagis[IsAttr.aINT] <> 0) then
          ~ We get half our value as bonus languages
          herofield[tLangsSta].value += round(field[abValue].value/2,0,-1)

          ~ And half our value x our hit dice as extra skill points
          #resmax[resSkill] += round(field[abValue].value/2,0,-1) * herofield[tHitDice].value
          endif
        endif
      ]]></eval>

    <eval index="3" phase="Final" priority="999"><![CDATA[
      if (tagis[Helper.WepAttune] <> 0) then
        field[usrCandid1].text = "component.BaseWep & !Helper.Static"

        ~ We can only target manufactured weapons, but Unarmed strikes count as
        ~ manufactured for monks (or other classes which gain their unarmed
        ~ strike abilities, so enable or forbid them accordingly).
        if (hero.tagis[Ability.cMnkUnarm] = 0) then
          field[usrCandid1].text &= " & !thingid.wUnarmed"
          endif

      elseif (tagis[Helper.ArmAttune] <> 0) then
        field[usrCandid1].text = "(component.BaseArmor & !Helper.Helper & !Helper.Static) | thingid.selClothin"
      elseif (tagis[Helper.AttrPhyAtt] <> 0) then
        field[usrCandid1].text = "component.BaseAttr & AttribCat.Physical"
      elseif (tagis[Helper.AttrMenAtt] <> 0) then
        field[usrCandid1].text = "component.BaseAttr & AttribCat.Mental"
        endif
      ]]></eval>

    <eval index="4" phase="Render" priority="1000000"><![CDATA[
      doneif (field[usrChosen1].ischosen = 0)

      perform field[usrChosen1].chosen.setfocus

      field[livename].text = focus.field[livename].text
      ]]></eval>
Aaron is offline   #2 Reply With Quote
Valdacil
Senior Member
 
Join Date: Feb 2017
Posts: 119

Old May 5th, 2017, 07:19 PM
Thank you for the script. I'll read through it in more detail when I have a chance since I've been most curious since we keep wanting to tweak the ABP stuff.

With regard to point number one, I'd already found the resource pool items, but on the ABP tab when you actually select the +2 bonus at level 6 for Mental Prowess for say Wisdom. That is what I'm looking for. What pick stores the data that Wisdom is selected for a +2 bonus. Given that information, I could make the adjustments to Wisdom after ABPAttune applies the enhancement bonus.

I would much prefer to handle this stacking issue from the ABP side vs your suggestion to alter the spells. If I can crack this nut, I'll have a single mechanic with a script or something vs. altering potentially numerous spells. Additionally, the spells should continue to not stack with each other, therefore they should stay enhancement bonuses.
Valdacil is offline   #3 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old May 6th, 2017, 06:41 AM
Ah, in that case you need to transition through the usrChosen1 field to see what that particular ABPAttune pick has chosen. For example:

Code:
~ Cycle through all our Attunements which are pointed at mental scores, and depending on which attribute they are choosing, do whatever.
foreach pick from hero from ABPAttune where "Helper.AttrMenAtt"

  ~ If we're choosing Intelligence...
  if (eachpick.field[usrChosen1].chosen.tagis[IsAttr.aINT] <> 0) then
    ~ Do whatever is appropriate
  ~ If we're choosing Wisdom...
  elseif (eachpick.field[usrChosen1].chosen.tagis[IsAttr.aWIS] <> 0) then
    ~ Do whatever is appropriate
  ~ If we're choosing Charisma...
  elseif (eachpick.field[usrChosen1].chosen.tagis[IsAttr.aCHA] <> 0) then
    ~ Do whatever is appropriate
    endif
  nexteach
Aaron is offline   #4 Reply With Quote
Valdacil
Senior Member
 
Join Date: Feb 2017
Posts: 119

Old May 6th, 2017, 11:35 PM
Ok, I just got clarification tonight that they essentially want to change all ABP bonuses to untyped so they stack with everything. I figured out how to do this with weapon attunement already. Earlier today I found the pick I needed to do physical/mental prowess. And I have what I need for armor attunement.

Now, apparently, I have to figure out Resistance and Deflection bonuses. So, I already know Resist comes from Ability.cABPResist, which gets bootstrapped by mechAutoBo. Not all of these are active however due to ClSpecWhen defined with the bootstrap. So I need to count how many copies of Ability.cABPResist are active to know what the total Resistance bonus is. Then I'll add another script to my ABP Adjustments mechanic to back out the bonus on svAll to svResist and instead apply the same number to Bonus.

The first thing I tried didn't work because HasAbility.cABPResist gets added to late to count on. What would be another good way to do this?
Valdacil is offline   #5 Reply With Quote
Valdacil
Senior Member
 
Join Date: Feb 2017
Posts: 119

Old May 7th, 2017, 12:09 AM
Ok, there may be a more direct way of doing this, but this is the way I know how and it works. I have the Resistance override apparently working. My override mechanic now has a new eval script at Post-levels/20001 (right after cABPResist applies the svResist bonus):

Code:
      ~ Valdacil: ABP adjustments for Resistance
      ~ Valdacil: Get our current ABP Resistance bonus
      var bonus as number

      foreach pick in hero from Ability where "thingid.cABPResist & Helper.FirstCopy & Helper.ShowSpec"
        bonus = maximum(bonus,eachpick.field[abValue].value)
      nexteach

      foreach pick in hero from BaseSave where "thingid.svAll"
        eachpick.field[svResist].value = maximum(0,eachpick.field[svResist].value - bonus)
        eachpick.field[Bonus].value += bonus
      nexteach
Tomorrow I should be able to apply very similar methodology to Deflection and Toughness. Armor Attunement, Mental Prowess, and Physical Prowess all use the ABPAttune thing as base for their pick, so I think I can apply similar methodology to what I already did for Weapon Attunement. After that, I believe I have them all covered. I'll post all the scripts I used once I do that in case anyone else wants them for any reason.
Valdacil is offline   #6 Reply With Quote
Valdacil
Senior Member
 
Join Date: Feb 2017
Posts: 119

Old May 7th, 2017, 11:26 AM
Ok, I've now modified all of the bonuses from ABP. Thanks again for posting that script. It was very helpful in a few key places (like the INT adjustments). This is what I've accomplished:

Resistance becomes untyped
Armor attunement becomes untyped
Weapon attunement becomes untyped
Deflection becomes untyped
Mental Prowess becomes a normal mod
Physical Prowess becomes a normal mod
Toughening becomes untyped

I did this via scripts on the mH_ABP thing I have which is overriding mechAutoBo. In addition to accomplishing above, I modified the boostraps so that ABP bonuses are not provided to companions or animals. You'll also see in the scripts below I removed the trackers for attunement once per day because they didn't really get used and were just cluttering the trackers on the InPlay tab.

There are 3 scripts on the mH_ABP thing. First script is just the default mechAutoBo script altered to remove the trackers. It runs at First/10000:

Code:
      ~ Valdacil: Remove trackers from Armor and Weapon attunement
      foreach pick in hero from BaseClSpec where "thingid.cABPArmAtt"
        perform eachpick.delete[User.Tracker]
      nexteach
      foreach pick in hero from BaseClSpec where "thingid.cABPWepAtt"
        perform eachpick.delete[User.Tracker]
      nexteach

      ~ Only do this if we are playing with the "No magic items at all" version
      ~ of the automatic bonus progression rules.
      doneif (hero.tagis[source.PUAutoBNoM] = 0)

      foreach pick in hero from BaseClSpec where "SpecSource.AutoBonPro"
        eachpick.field[xExtraLev].value += 2
        nexteach
The 2nd script fixes up all of the ABP bonuses that use the ABPAttune thing to make a pick. This includes armor/weapon attunement and mental/physical prowess. Since I changed the attribute bonuses to normal mod, there was no longer a need to manually add skill points and languages, therefore had to back out the extra ones added by the ABP script posted above. This script runs at Post-levels/10001 (right after ABPAttune runs at Post-levels/10000):

Code:
       ~ Valdacil: Find all ABPAttune
       foreach pick in Hero from ABPAttune
         ~ Back out the default ABP enhancement bonus
         eachpick.field[usrChosen1].chosen.field[BonEnhance].value = maximum(0,eachpick.field[usrChosen1].chosen.field[BonEnhance].value - eachpick.field[abUserVal].value)
		 
       ~ If it is an attribute (physical or mental prowess) make it a normal mod, otherwise make it untyped bonus
         If (eachpick.field[usrChosen1].chosen.tagis[component.BaseAttr] <> 0) Then
           eachpick.field[usrChosen1].chosen.field[aNormMod].value += eachpick.field[abUserVal].value
           ~ ABP manually adds languages and skill points, we need to back those out
           If (eachpick.field[usrChosen1].chosen.tagis[thingid.aINT] <> 0) Then
             herofield[tLangsSta].value -= round(eachpick.field[abValue].value/2,0,-1)
             #resmax[resSkill] -= round(eachpick.field[abValue].value/2,0,-1) * herofield[tHitDice].value
           EndIf
         Else
           eachpick.field[usrChosen1].chosen.field[Bonus].value += eachpick.field[abUserVal].value
         EndIf
       nexteach
The last script fixes up Resistance, Deflection, and Toughening. This script runs at Post-levels/20001 (right after each of their abilities run at Post-levels/20000):

Code:
      ~ Valdacil: ABP adjustments for Resistance, Deflection, Toughening
      ~ Valdacil: Get our current ABP Resistance bonus
      var bonus as number

      bonus = 0
      foreach pick in hero from Ability where "thingid.cABPResist & Helper.FirstCopy & Helper.ShowSpec"
        bonus = maximum(bonus,eachpick.field[abValue].value)
      nexteach

      foreach pick in hero from BaseSave where "thingid.svAll"
        eachpick.field[svResist].value = maximum(0,eachpick.field[svResist].value - bonus)
        eachpick.field[Bonus].value += bonus
      nexteach

      ~ Get our current ABP Deflection bonus
      bonus = 0
      foreach pick in hero from Ability where "thingid.cABPDeflec & Helper.FirstCopy & Helper.ShowSpec"
        bonus = maximum(bonus,eachpick.field[abValue].value)
      nexteach

      foreach pick in hero from BaseAC where "thingid.ArmorClass"
        eachpick.field[tACDeflect].value = maximum(0,eachpick.field[tACDeflect].value - bonus)
        eachpick.field[Bonus].value += bonus
      nexteach

      ~ Get our current ABP Toughening bonus
      bonus = 0
      foreach pick in hero from Ability where "thingid.cABPTough & Helper.FirstCopy & Helper.ShowSpec"
        bonus = maximum(bonus,eachpick.field[abValue].value)
      nexteach

      foreach pick in hero from BaseArmor where "thingid.mNatural"
        eachpick.field[BonEnhance].value = maximum(0,eachpick.field[BonEnhance].value - bonus)
        eachpick.field[Bonus].value += bonus
      nexteach
This is all working properly. I grant that there may be better ways to accomplish this than all of the foreach's I used, but this was the way I knew how to do it. If anyone wants to post suggestions that tweak my code for efficiency, I'm open to that.
Valdacil is offline   #7 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 07:34 AM.


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