• 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

Problems selecting ability score bonus

AndrewD2

Well-known member
The race I'm working on can either have +2 Strength or +2 Con, +2 Wis, -2 Int.

So I created 2 R Cust Special, one for each option, and then set the eval script for each to do the associated adjustments. Then I created a Racial Special to do the pick with a Custom Expression of thingid.rcAb1|thingid.rcAb2 so the choices show up in the race. If I bootstrap them to the special they both activate and if I don't bootstrap them then nothing happens except the selection happening.

I'm not sure if there is a way to conditionally bootstrap the items or if I need to adjust where my calculations are happening.

Any help is great.
Thanks,
Andrew
 
I added some tags custom tags and conditions to the bootstraps. Here's the code for the various parts of this race.

The Dahren Race
Code:
    <thing id="rDahren" name="Dahren" compset="Race">
    <tag group="HasType" tag="tpHumanoid"/>
    <tag group="RaceType" tag="Normal"/>
    <tag group="RaceSize" tag="Medium0"/>
    <tag group="Language" tag="Any"/>
    <bootstrap thing="lCommon"></bootstrap>
    <bootstrap thing="lGiant"></bootstrap>
    <bootstrap thing="raLowLight"></bootstrap>
    <bootstrap thing="stGiant"></bootstrap>
    <bootstrap thing="raDahrenAb"></bootstrap>
    </thing>

Dahren Ability Bonus +2 Con, +2 Wis, -2 Int
Code:
  <thing id="rcDahrenCo" name="+2 CON, +2 Wisdom, -2 Intelligence" description="You gain an additional +2 racial bonus to your Constitution and Wisdom scores and a -2 racial penalty to your Intelligence." compset="RaceCustom" summary="+2 racial bonus to your Constitution score." uniqueness="useronce">
    <usesource source="PCBldAngel" parent="PCHeader" name="Blood of Angels"/>
    <tag group="Helper" tag="SpecUp" name="SpecUp" abbrev="SpecUp"/>
    <tag group="RaReplace" tag="raAaDay" name="Daylight" abbrev="Daylight"/>
    <tag group="Helper" tag="NoPathSoc" name="Not Allowed for Pathfinder Society Characters" abbrev="Not Allowed for Pathfinder Society Characters"/>
    <tag group="AllowRCust" tag="rDahren"/>
    <eval phase="PreAttr" priority="10000">hero.child[aCON].field[aStartMod].value += 2
hero.child[aWIS].field[aStartMod].value += 2
hero.child[aINT].field[aStartMod].value -= 2</eval>
    </thing>

Dahren Ability Bonus +2 Str
Code:
  <thing id="rcDahrenSt" name="+2 STR" description="You gain an additional +2 racial bonus to your Strength score." compset="RaceCustom" summary="+2 racial bonus to your Constitution score." uniqueness="useronce">
    <usesource source="HeroesJade"/>
    <tag group="RaReplace" tag="raAaDay" name="Daylight" abbrev="Daylight"/>
    <tag group="Helper" tag="NoPathSoc" name="Not Allowed for Pathfinder Society Characters" abbrev="Not Allowed for Pathfinder Society Characters"/>
    <tag group="AllowRCust" tag="rDahren"/>
    <tag group="Helper" tag="SpecUp" name="SpecUp" abbrev="SpecUp"/>
    <eval phase="PreAttr" priority="10000">hero.child[aSTR].field[aStartMod].value += 2</eval>
    </thing>

Dahren Ability Scores
Code:
  <thing id="raDahrenAb" name="Dahren Ability Score" description="The Dahren’s massive physique grants them prodigious Strength\nand Constitution. They enjoy choosing to focus on their physique\ngranting a single +2 racial bonus to Strength; or focusing on physical\nand mental fortitude granting a +2 racial bonus to Constitution,\na +2 racial bonus to Wisdom, and a -2 penalty to Intelligence." compset="RaceSpec">
    <fieldval field="usrCandid1" value="thingid.rcDahrenSt|thingid.rcDahrenCo"/>
    <tag group="RaceSort" tag="Attribute" name="Attribute" abbrev="Attribute"/>
    <tag group="ChooseSrc1" tag="Thing"/>
    <tag group="Custom" tag="DahrenCo"/>
    <tag group="Custom" tag="DahrenSt"/>
    <bootstrap thing="rcDahrenCo">
      <containerreq phase="First" priority="500">hero#Custom.DahrenCo</containerreq>
      </bootstrap>
    <bootstrap thing="rcDahrenSt">
      <containerreq phase="First" priority="500">hero#Custom.DahrenSt</containerreq>
      </bootstrap>
    <eval phase="PreAttr" priority="5000"><![CDATA[if (field[usrChosen1].ischosen <> 0) then
  if (field[usrChosen1].chosen.tagis[thingid.rcDahrenSt] <> 0) then
    perform hero.assign[Custom.DahrenSt]
  endif  
  if (field[usrChosen1].chosen.tagis[thingid.rcDahrenCo] <> 0) then
    perform hero.assign[Custom.DahrenCo]
  endif
endif]]></eval>
    </thing>
 
Aaaand I just figured it out. My tags were getting assigned too late so I moved the up to First/450.

The biggest question is if I should adjust Phase/Priority
 
I gave the Dahren a racial custom ability count of 1. Than I created 2 R Cust Specials with the eval script to calculate the abilities new (Pre-Attributes (User) Priority: 10000).

I you select the Dahren, you can select the racial Custum Ability at the background tab - and it works. I had no problem....

It's possible to use 2 different sorts of Racial Custum Abilities. i think you can use this for the Shenxue (Ancestor Aspect and Spiritual Aspect).
 
Last edited:
How to simplify that:

Code:
 <thing id="raDahrenAb" name="Dahren Ability Score" description="The Dahren’s massive physique grants them prodigious Strength and Constitution. They enjoy choosing to focus on their physique granting a single +2 racial bonus to Strength; or focusing on physical and mental fortitude granting a +2 racial bonus to Constitution, a +2 racial bonus to Wisdom, and a -2 penalty to Intelligence." compset="RaceSpec">
    <arrayval field="usrArray" index="0" value="+2 Str"/>
    <arrayval field="usrArray" index="1" value="+2 Con, +2 Wis, -2 Int"/>
    <tag group="RaceSort" tag="Attribute" name="Attribute" abbrev="Attribute"/>    <tag group="Custom" tag="DahrenCo"/>
    <eval phase="PreAttr" priority="5000"><![CDATA[
      if (compare(field[usrSelect].text,"+2 Str") = 0) then
        hero.child[aSTR].field[aStartMod].value += 2
      else
        hero.child[aCON].field[aStartMod].value += 2
        hero.child[aWIS].field[aStartMod].value += 2
        hero.child[aINT].field[aStartMod].value -= 2
        endif
    ]]></eval>
    </thing>

That let's you ditch the two helper abilities and not have to worry about bootstrap conditions.

(I also deleted 4 linebreaks in the description that appeared to be within sentances, not at paragrph breaks).
 
I like it. Now looking at that would I even need the custom tag anymore?

EDIT:
I tested it without the custom tag and all seems to be working fine so I think I answered my own question.
 
Last edited:
Back
Top