• 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

Does a feat can modify racial trait bonus?

peterphonic

Active member
Does a feat can modify racial trait bonus?

Hello,

I have the following, for my custom race (Kaiyigiss)

Custom Racial trait :
Kaiyigiss Damage Resistance : (5/slashing).

Custom Feat :
Ironbark. Damage Resistance (5/slashing) becomes (constitution modifier/-)

Is there an example of that somewhere?

Thx
 
Last edited:
I did the following to add DR/- with the constitution modifier

Code:
      ~ If we're disabled, do nothing
      doneif (tagis[Helper.FtDisable] <> 0)
      

      field[abValue].value += #attrbonus[aCON]
      #applyresist[xDamRd,field[abValue].value]

But I still need to find a way to remove the special ability DR/Slashing

I tried this
Code:
#deleteresit[xDamRds]

and this
Code:
#removeresit[xDamRds]

But that did not work at all...

Somebody have an example how to remove or disable a special ability from a feat?

Thank you!
 
I believe all damage resists exists all the time on all characters. You cannot 'remove' the damage resist, you instead need to modify it's value (setting it to zero). The problem with this, though, is that there may very well be something else on the character that is granting DR/Slashing, and you would end up wiping that out as well. It is likely best, if you have a racial trait, and a racial feat that AFFECTS that trait, to have it do just that, instead of each manipulating the values. Instead of script in each, simply script something like the following in the racial trait (I have not tested this):

Code:
~ If we're disabled, do nothing
      doneif (tagis[Helper.FtDisable] <> 0)
      
~ Apply the proper DR, depending on presence of the IronBark feat.
      if (#hasfeat[fIronBark]) then
            field[abValue].value = #attrbonus[aCON]
            #applyresist[xDamRd,field[abValue].value]
      else
            field[abValue].value = 5
            #applyresist[xDamRds,field[abValue].value]
      endif
 
Thx fuzzy. Works like a charm. I actually did that :

Code:
      ~ If we're disabled, do nothing
      doneif (tagis[Helper.SpcDisable] <> 0)

~ Apply the proper DR, depending on presence of the IronBark feat.
      if (#hasfeat[fIronbaKai] <> 0 ) then
            field[abValue].value = #attrbonus[aCON]
            #applyresist[xDamRd,field[abValue].value]
      else
            field[abValue].value = 5
            #applyresist[xDamRdS,field[abValue].value]
      endif

Now, final thing, I would like to change summary text of my racial trait. My racial trait Kaiyigiss Damage Reduction has this summary text : "Damage Reduction (5/Slashing)". I would like to change that text.

So, I am really progressing with scripting, but I am still a little bit confused between field and tag.

I know that I need to do somethig like this to change the text :

Code:
field[abSumm].text = "Damage Reduction (" & signed(#attrbonus[aCON]) & "/-)"

But I don't know what to look for in the tag windows.

Thanks for your help!
 
Think of tags as post-it notes placed on the item - they're there to remind you that something has a certain property, or does not fall within a certain category.

Fields store data that's not a simple yes-no - they store numbers like the final adjusted modifier for an attribute, or they store bits of text like the text that will be placed in the summary.

That last line of code won't actually work. #attrbonus[aCON] is a math operation, and you can't have a math operation inside a text operation. You'll need to do the math operation first, store it in a variable, then use the variable in your text operation:
Code:
var conbonus as number
conbonus = #attrbonus[aCON]
field[abSumm].text = "Damage Reduction (" & signed(conbonus) & "/-)"
 
Thx for your explanation Mathias.

For the abSumm field, it still not showing like I want though. It is alway showing the default summary text, when I do a mouse over the question mark (background tab). The following is what I did :

Code:
     ~ If we're disabled, do nothing
      doneif (tagis[Helper.SpcDisable] <> 0)

~ Apply the proper DR, depending on presence of the IronBark feat.
      if (#hasfeat[fIronbaKai] <> 0 ) then
            field[abValue].value = #attrbonus[aCON]
            #applyresist[xDamRd,field[abValue].value]
            var conbonus as number
            conbonus = #attrbonus[aCON]
            field[abSumm].text = "Damage Reduction (" & signed(conbonus) & "/-)"
      else
            field[abValue].value = 5
            #applyresist[xDamRdS,field[abValue].value]
            field[abSumm].text = "Damage Reduction (5/Slashing)"
      endif

The above script is for a Racial Special ability that I had created : "Kaiyigiss Damage Recution" (Id : raKaiDamRe)

My question is, what is the magic of field[abSumm].text? How the software knows that I want to change the text of "Kaiyigiss Damage Recution"? Is it because the script is stored under raKaiDamRe?

Thank you
 
Is it showing the correct text on the Special tab?

Also, phase & priority of that script?

Check out this article on what the dots mean: http://forums.wolflair.com/showthread.php?t=21663

That explains how to move around through the data in Hero Lab. The code "field[abSumm].text" doesn't move anywhere else before transitioning to a field - that's why it alters the abSumm field on itself.
 
Ohhh, my bad. Just realized that CustDesc was the field that I had to modify.

The following is working like a charm :

Code:
     ~ If we're disabled, do nothing
      doneif (tagis[Helper.SpcDisable] <> 0)

~ Apply the proper DR, depending on presence of the IronBark feat.
      if (#hasfeat[fIronbaKai] <> 0 ) then
            field[abValue].value = #attrbonus[aCON]
            #applyresist[xDamRd,field[abValue].value]
            var conbonus as number
            conbonus = hero.child[aCON].field[aBonus].value
            field[CustDesc].text = "{i}Damage Reduction (" & signed(conbonus) & "/-){/i}\n\nYou have Damage Reduction against all attacks."
      else
            field[abValue].value = 5
            #applyresist[xDamRdS,field[abValue].value]
            field[CustDesc].text = "{i}Damage Reduction (5/Slashing){/i}\n\nYou have Damage Reduction against all attacks except Slashing"
      endif

Sorry for my mistake! One more last thing. The following :
Code:
field[CustDesc].text = "{i}Damage Reduction (" & signed(conbonus) & "/-){/i}\n\nYou have Damage Reduction against all attacks."

Returns : Damage Reduction (+2/-) .... Is it possible to easily remove the + in front of the 2 ?

I looked string formatting, and I did not see anything to do such operations.

Thx again for your patience!
 
signed() means display the number as a signed number - with a + if it's >= 0, or with a - if it's < 0.

So, just using conbonus by itself, not signed(conbonus) will display it without the +.
 
Back
Top