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
BenT1
Junior Member
 
Join Date: May 2010
Posts: 25

Old May 26th, 2010, 04:33 PM
I am trying to create a feat, Shield Ward.

It will add the Hero's Shield AC bonus (including magic) to his Touch AC and his CMD. Here is the script I have to far, but it Herolab doesn't seem to like it much.


~find all our shields
foreach pick in hero from BaseArmor where "EquipType.Shield"

var bonus as number
~if it's equipped
if (eachpick.field[gIsEquip].value <> 0) then
bonus = eachpick.field[tACShield].value
eachpick.field[tACTouch].value += bonus
endif
nexteach

It compiles it without a complaint, but it does not adjust the Touch AC of the character. Then there is figuring out how to add it to the CMD.....

And when it is used on a character with a Magic Shield, Herolabs complains bitterly that the 'attempt to access field "TACShield" that does not exist for thing "IMagArmor"'

BenT1
BenT1 is offline   #1 Reply With Quote
BenT1
Junior Member
 
Join Date: May 2010
Posts: 25

Old May 26th, 2010, 04:34 PM
By the way, the Weapon talent of the Fighter's does transfer now, Thanks!!

BenT1
BenT1 is offline   #2 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 27th, 2010, 08:04 AM
So you where pretty close actually, but a few problems. The AC field on shields is actually arAC not tACShield. Then you where trying to modify the touch AC on the shield by using eachpick.field[tACTouch].value. What you really wanted to do was modify the Touch AC of the hero. So you needed hero.child[ArmorClass].field[tACTouch].value.

You didn't say what your timing was for the script, but some playing around shows that Post-Attributes 10,000 seems to work the best for Magic and nonmagic shields.

Here is the final working script.
Code:
~Post-attributes 10,000
var bonus as number

~find all our shields
foreach pick in hero from BaseArmor where "EquipType.Shield"
  ~if it's equipped
  if (eachpick.field[gIsEquip].value <> 0) then
    bonus = eachpick.field[arAC].value
    hero.child[ArmorClass].field[tACTouch].value += bonus
  endif
nexteach

Quote:
Originally Posted by BenT1 View Post
Then there is figuring out how to add it to the CMD.....
Check out the CMB/CMD for weapons thread where I am doing stuff with CMB/CMD and Mathias answers a bunch of questions on it. Plus their are some example scripts you should be able to use as a base.

Hope that helps.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #3 Reply With Quote
BenT1
Junior Member
 
Join Date: May 2010
Posts: 25

Old May 27th, 2010, 03:30 PM
Thanks for the help ShadowC, I appreciate it. I just moved the timing to Final/10000 so it would also pick up the Enhancement bonus of the shield.

BenT1
BenT1 is offline   #4 Reply With Quote
BenT1
Junior Member
 
Join Date: May 2010
Posts: 25

Old May 27th, 2010, 03:53 PM
This is a script where I am trying to count the number of 'Draconic' feats a character has and use the number to determine the abilities granted by the feat. Timing is set at Final/10001. The var bonus is returning a 1, even though the character has 4 'Draconic' feats. I used the example from the help file to create the tagcount[fCategory.Draconic]

var bonus as number
~ Count our Draconic feats- How many do I have?
bonus = tagcount[fCategory.Draconic]
#skillbonus[skPercep] += bonus

~ gain low light vision
field[livename].text = "Lowlight Vision" & " Bonus" & bonus
~ Improve our darkvision if necessary
if (bonus >= 3) then hero.child[raDarkVis].field[abValue].value = maximum(hero.child[raDarkVis].field[abValue].value,60)
endif
if (bonus >= 4) then hero.child[rBlindsen].field[abValue].value = maximum(hero.child[rBlindsen].field[abValue].value,20)
endif
BenT1 is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old May 27th, 2010, 11:16 PM
If you use tagcount[fCategory.Draconic], you're counting the number of fCategory.Draconic tags on the thing where the script is running - so just that feat.

hero.tagcount[fCategory.Draconic] will get you the total number of tags on the character.
Mathias is offline   #6 Reply With Quote
BenT1
Junior Member
 
Join Date: May 2010
Posts: 25

Old May 28th, 2010, 02:31 PM
Ok, that does return the proper value for the var bonus. But it is not adding to the #skillbonus[skPercep] += bonus is not adding it correctly to the Perception skill. It is still only adding 1, even though it is returning a value of 4. And my If statements are returning errors, 'extra characters on end of line'. I originally tried to assign the racial ability 'raLowLight', but that did not work.... I know it can be done, just can't find an example of it.

BenT1
BenT1 is offline   #7 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 28th, 2010, 06:41 PM
Quote:
Originally Posted by BenT1 View Post
~ Improve our darkvision if necessary
if (bonus >= 3) then hero.child[raDarkVis].field[abValue].value = maximum(hero.child[raDarkVis].field[abValue].value,60)
endif
if (bonus >= 4) then hero.child[rBlindsen].field[abValue].value = maximum(hero.child[rBlindsen].field[abValue].value,20)
endif
Assuming this is exact, as you don't have it wrapped in code, you can't have stuff after the THEN except a new line.

Try this.
Code:
~ Improve our darkvision if necessary
    if (bonus >= 3) then
      hero.child[raDarkVis].field[abValue].value = maximum(hero.child[raDarkVis].field[abValue].value,60)
    endif
    if (bonus >= 4) then
      hero.child[rBlindsen].field[abValue].value = maximum(hero.child[rBlindsen].field[abValue].value,20)
    endif

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #8 Reply With Quote
BenT1
Junior Member
 
Join Date: May 2010
Posts: 25

Old May 28th, 2010, 08:06 PM
Yes, it was a cut and paste. Thanks for the format info.

But, how does one check and assign a racial ability using a script?

The editor complains about trying to access a non-live child pick for raDarkVis and raBlindsen.

BenT1

Last edited by BenT1; May 28th, 2010 at 08:24 PM.
BenT1 is offline   #9 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 29th, 2010, 09:57 AM
Quote:
Originally Posted by BenT1 View Post
But, how does one check and assign a racial ability using a script?

The editor complains about trying to access a non-live child pick for raDarkVis and raBlindsen.
My understanding here is that you have to "Bootstraps" that ability on to your Thing before you can try and access it.

So for example if I wanted to apply Silver DR to a creature I first would have to bootstrap on xDamRdSil (Damage Reduction, Silver) so that it would have the Thing to apply against.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #10 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 11:25 PM.


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