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
peterphonic
Member
 
Join Date: Aug 2014
Posts: 44

Old September 17th, 2014, 06:56 AM
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 by peterphonic; September 17th, 2014 at 09:53 AM.
peterphonic is offline   #1 Reply With Quote
peterphonic
Member
 
Join Date: Aug 2014
Posts: 44

Old September 18th, 2014, 06:44 PM
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!
peterphonic is offline   #2 Reply With Quote
Fuzzy
Senior Member
 
Join Date: Jul 2012
Posts: 416

Old September 19th, 2014, 12:47 AM
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
Fuzzy is offline   #3 Reply With Quote
peterphonic
Member
 
Join Date: Aug 2014
Posts: 44

Old September 19th, 2014, 04:47 PM
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!
peterphonic is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old September 20th, 2014, 09:38 AM
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) & "/-)"
Mathias is offline   #5 Reply With Quote
peterphonic
Member
 
Join Date: Aug 2014
Posts: 44

Old September 20th, 2014, 11:35 AM
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
peterphonic is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old September 20th, 2014, 11:58 AM
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.
Mathias is offline   #7 Reply With Quote
peterphonic
Member
 
Join Date: Aug 2014
Posts: 44

Old September 20th, 2014, 03:14 PM
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!
peterphonic is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old September 20th, 2014, 03:39 PM
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 +.
Mathias is offline   #9 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 12:13 AM.


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