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
jas0042
Member
 
Join Date: Jan 2014
Posts: 32

Old January 12th, 2014, 08:27 AM
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.
jas0042 is offline   #1 Reply With Quote
jas0042
Member
 
Join Date: Jan 2014
Posts: 32

Old January 12th, 2014, 08:36 AM
Found the list - under the Editor Help. Would still like to know if my script will work the way I want thought. Thanks!
jas0042 is offline   #2 Reply With Quote
jas0042
Member
 
Join Date: Jan 2014
Posts: 32

Old January 12th, 2014, 08:50 AM
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.
jas0042 is offline   #3 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old January 12th, 2014, 09:13 AM
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.
Aaron is offline   #4 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old January 12th, 2014, 10:28 AM
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.
ShadowChemosh is offline   #5 Reply With Quote
jas0042
Member
 
Join Date: Jan 2014
Posts: 32

Old January 12th, 2014, 05:49 PM
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.
jas0042 is offline   #6 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old January 12th, 2014, 06:10 PM
Quote:
Originally Posted by jas0042 View Post
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.
The problem is all their is in HL is a counter that marks a spell as used. The issue is that a spell lasts X amount of time but recovering the spell slot you cast is Y amount of time.

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.
ShadowChemosh is offline   #7 Reply With Quote
jas0042
Member
 
Join Date: Jan 2014
Posts: 32

Old January 12th, 2014, 06:33 PM
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
jas0042 is offline   #8 Reply With Quote
jas0042
Member
 
Join Date: Jan 2014
Posts: 32

Old January 12th, 2014, 06:59 PM
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!!!
jas0042 is offline   #9 Reply With Quote
Mystic Lemur
Senior Member
 
Join Date: Aug 2013
Location: Alabama
Posts: 254

Old January 16th, 2014, 07:54 AM
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?
Mystic Lemur 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 09:59 PM.


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