• 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

Base Race vs. Base Creature

frumple

Well-known member
I know findchild[BaseRaace] allows us to find the base race that makes up the hero, but what about the base creature? That is the hero before a template is applied (with class levels, etc).

The reason I ask is that I have an acquired template that makes a creature incorporeal, however if the base creature's Strength is greater than its Dexterity its Dexterity becomes the Strength. The timing seems problematic since I want to change an ability's final score after it has been calculated. This is not just a PostMod, but a full substitution.
 
findchild[BaseRace] will take you to the race regardless of whether a template has been added to the hero. It sounds like you're trying to get at the racial attribute bonuses before templates add to them. Am I correct? In that case your script should run before First 10000, which is when templates do their thing.
 
Also, doesn't the incorporeal racial special ability already sub Dex for Str? Can't you just bootstrap the racial special?
 
Yep I am trying to access the hero's scores before the template is applied.

In this case I want the reverse of normal incorporeal to happen (where Dex subs for Str). If the base creature's Strength is larger, the templated creature's Dex becomes that score. So for instance if my base creature has Str 25, Dex 12 after the template it would have Str -, Dex 25 (the noscore on Str is taken care of the by incorporeal subtype and trait).
 
Got it working... turns out it was a timing issue. Running at First/9000 it works fine.

But now something else strange has arisen. The new Dex modifier is not being applied to AC for some reason. Is this another timing issue? When is the Dex mod put into tACDexMod? (I can easily script around this but just wanted to make sure I am not missing something).
 
That's weird. I might have expected that with CMD, but not with the AC, could you post the eval script?
 
It does work for CMD at the timing I have

Here is the code
Code:
First/9000

~ if Str is greater that Dex make Dex equal to Str score

var strScore as number
var dexScore as number
strScore = hero.child[aSTR].field[aStartMod].value
dexScore = hero.child[aDEX].field[aStartMod].value


if (strScore > dexScore) then
  hero.child[aDEX].field[aStartMod].value += strScore - dexScore + 4
endif

The +4 is the bonus from the template.
 
I thought you were looking at the race rather than the attributes? Here is something I recently did for one of the ISC archetypes, which gets an animal companion which is undead but shifts the races normal Con bonus to Charisma.

Code:
    <eval phase="First" priority="625" index="3">
      doneif (hero.childlives[cAnimComp] = 0)

      ~undead use their CHA mod in place of their CON mod
      perform hero.childfound[cAnimComp].minion.findchild[BaseRace].setfocus

      doneif (state.isfocus = 0)

      focus.field[rCHA].value = focus.field[rCON].value
      <before name="Racial Stats"/>
      <after name="Companion Advancement"/>
      </eval>

Obviously, you don't need to worry about the animal companion parts of that, but the theory is the same. Intervene with the chosen race's abilities before any templates add their bonuses to the race.
 
Right, but what if the hero the template is being placed on has increased/decreased the abilities so they are not the same as the base race.

For example a human would return 0 for any of its abilities (since the race has no ability modifiers). But after giving it some class levels the ability scores will be different than that of the base race.
 
Back
Top