• 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

Resetting setfocus

Umarian

Well-known member
Working on a complex race, and trying to get an Alternate Racial Trait to reset the selection of ability modifiers similar to the Tiefling Heritages. The race has a selection of animals to choose from that adjusts the ability scores. One of the selections is below:

Code:
  <thing id="rcMSApe" name="Ape" description="{b}{u}Ability Modifiers:{/b}{/u} +2 Str, +2 Con, -2 Cha\n\n{b}Ability Scores:{/b} In all forms, +2 to two physical ability scores and -2 to one mental ability score determined by the natural lycanthrope&apos;s Base Animal. Natural lycanthropes are physically robust, but are torn between their bestial and civilized natures and suffer conflicting impulses. See the accompanying table for a list of animal forms and their statistic adjustments." compset="RaceCustom" summary="{b}Ability Modifiers:{/b} +2 Str, +2 Con, -2 Cha">
    <tag group="AllowRCust" tag="rMSLycNatu"/>
    <tag group="Helper" tag="Secondary"/>
    <tag group="Helper" tag="SpecUp"/>
    <eval phase="First" priority="602"><![CDATA[~If we have been replaced, then get out now
    doneif (tagis[Helper.SpcDisable] <> 0)

~set our focus to the hero's race
    perform hero.findchild[BaseRace].setfocus
      doneif (state.isfocus = 0)

~We need to add our animal abilities to our race.
      focus.field[rSTR].value += 2
      focus.field[rCON].value += 2
      focus.field[rCHA].value -= 2]]></eval>
    <eval phase="First" priority="601" index="2"><![CDATA[~set our focus to the hero's race
    perform hero.findchild[BaseRace].setfocus
      doneif (state.isfocus = 0)

~Now we want to add our Base Race (Animal) side to our race name also.
    focus.field[livename].text &= ", " & field[name].text & ")"]]></eval>
    </thing>

I put a shut-down code on the first Eval Script hoping that it would not run the setfocus, but I do still want the second eval script to run, so I left it off that one.

The problem I am having, is that with the Alt Racial Trait I am working on, it replaces the scores set above. When I try to Replace the selection above, it is still running the focus for both abilities. I have set the timing for the trait both before (601) and after (603) the timing of the above Racial Special (602).

Code:
  <thing id="raMSRunLit" name="Runt of the Litter" description="The insular nature of natural lycanthropic society sometimes leads to inbreeding. Natural lycanthropes with this racial trait have the following modified base statistics: +2 Dexterity, +2 Intelligence, -2 Constitution. This replaces the normal statistics modifiers granted by their base animal." compset="AltRaceTrt" uniqueness="unique">
    <tag group="AllowRCust" tag="rMSLycNatu"/>
    <tag group="RaReplace" tag="rcMSApe"/>
    <eval phase="First" priority="601"><![CDATA[~set our focus to the hero's race
    perform hero.findchild[BaseRace].setfocus
      doneif (state.isfocus = 0)

~We need to add our animal abilities to our race.
      focus.field[rDEX].value += 2
      focus.field[rINT].value += 2
      focus.field[rCON].value -= 2]]></eval>
    </thing>

How can I get the Trait to set the Ability scores, if it is selected, instead of the animal selection?
 
Focus is not retained between scripts. You've got each of your two scripts setting the focus itself.

If you're trying to keep the ability score modifier one from running in some circumstances, concentrate on when the Helper.SpcDisable tag is being added, compared to when this script is running. If you're counting on the normal ART mechanisms to handle that replacement, I'm sure it hasn't happened by the ultra-early phase you're using for your scripts. Try a more normal phase than First - that phase is supposed to be reserved for things that absolutely have to happen early, because everything else about the character depends on knowing those values. Setting the attribute modifiers on the race and setting livenames don't qualify as important enough to belong in the First phase.
 
Back
Top