Member
Join Date: Jan 2014
Posts: 32
|
Is there a list somewhere of Field Id's that Hero labs uses? I'm trying my hand at writing basic script for a few things.
Right now I'm trying to create a Mage Armor spell that automatically increase my AC when it's cast, rather than having to switch to the Adjustments tab and select the Mage Armor adjustment. My basic plan was to create a new spell in the Editor, calling it Mage Armor Me or something then when cast would run this script (please don't laugh ): hero.child[?].field[Bonus].value += 4 Not sure if this is the best way to do it or what the AC is called by Hero Lab. |
#1 |
Member
Join Date: Jan 2014
Posts: 32
|
Found the list - under the Editor Help. Would still like to know if my script will work the way I want thought. Thanks!
|
#2 |
Member
Join Date: Jan 2014
Posts: 32
|
I know realize that I need an if statement. The script I used :
hero.child[ArmorClass].field[Bonus].value = hero.child[ArmorClass].field[Bonus].value + 4 automatically applies the AC bonus if I put it in my spellbook. I need a way to apply it only if I cast it. |
#3 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Make a copy of the mage armor adjustment and you can use that as the basis for your new script, the one you have now is going to apply an untyped bonus to AC, which will stack with all other bonuses (including armor bonuses).
The chief concern I have is about how you will trigger the effect to be applied. You could base it off the "number used" field being non-zero, but then when your spell's duration expires the only way to turn it back off would be to increment it so that it seems you haven't cast it all. That's likely to make tracking what spells you have or have not cast difficult. Can I ask why you would prefer not to add the effect by applying a spell adjustment? It's possible your feedback could help improve that mechanism. |
#4 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
If playing around in the Editor my advice is to read the Glossary of Terms to get a handle on the wording.
Then read FAQ#2 in the Editor section to find all the places to find help. This section also has a nice four part intro video on the editor. It covers finding names and fields. 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. |
#5 |
Member
Join Date: Jan 2014
Posts: 32
|
Anyone else know how to access the variable related to whether a spell has been cast or not? I've read for hours and still am no closer to figuring it out.
|
#6 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
So I really don't see how linking the two together makes any real game play sense. Just cause I cast the spell does not mean the spell is "active". What happens when the enemy casts Dispel Magic on you and Boom its been dispelled. You going to reset the spell as not cast then? Here is a list of all the fields on a Spell and I highlighted the two fields that control the uses of a spell: Image2.jpg 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. |
|
#7 |
Member
Join Date: Jan 2014
Posts: 32
|
Thanks for the help. I found it just before you replied by watching your "Eval Scripts and Fields Part 2" youtube vid. I guess that makes sense that it wouldn't really work in game play since it's not always effective. I guess that's why they created the adjustment for it.
Just for my education, as I learn how this works - would the script be: if (field[spMageArm1].chosen.field[sCastCount].value = 1) then hero.child[ArmorClass].field[Bonus].value = hero.child[ArmorClass].field[Bonus].value + 4 |
#8 |
Member
Join Date: Jan 2014
Posts: 32
|
Actually it was :
if (field[sCastCount].value = 1) then hero.child[ArmorClass].field[Bonus].value = hero.child[ArmorClass].field[Bonus].value + 4 endif And it worked!!! |
#9 |
Senior Member
Join Date: Aug 2013
Location: Alabama
Posts: 254
|
Shouldn't it be:
if (field[sCastCount].value = 1) then hero.child[ArmorClass].field[tACArmor].value = maximum(hero.child[ArmorClass].field[tACArmor].value, 4) endif And, as ShadowChemosh pointed out, what do you do when the duration expired or it's dispelled? There's no way to turn it off without marking the spell as castable again. Why is this easier then just checking/unchecking a box on the spell adjustments tab? |
#10 |
|
|