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
unforgivn
Member
 
Join Date: Dec 2010
Posts: 62

Old March 25th, 2011, 12:51 PM
I'm trying to create a feat that improves max Dex and armor check penalties by 1 like Armor Training for a selected type of armor (similar to Weapon Focus). The problem is that entering EquipType.Armor in the custom expression field (restricted to All Things) always results in a "Nothing to choose from" message when the feat is added to a character.

Also, disabling the user selection entirely still has no effect on any purchased armors. Here's my simplified script:

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

      ~ If we haven't chosen anything, get out now
      ~doneif (field[usrChosen1].ischosen + tagis[Target.?] = 0)

      ~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] = 0)

      ~Improve the armor check penalty and max dex stats of our armors.
      foreach pick in hero from BaseArmor
        eachpick.field[arArmorChk].value += field[abValue].value
        eachpick.field[arMaxDex].value += field[abValue].value
      nexteach
The script timing is the same as those from Weapon Focus since I started with a copy of that feat as my base.

Thanks in advance.

Last edited by unforgivn; March 25th, 2011 at 12:53 PM.
unforgivn is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old March 25th, 2011, 01:35 PM
Quote:
Originally Posted by unforgivn View Post
The script timing is the same as those from Weapon Focus since I started with a copy of that feat as my base.
Could you please tell us that phase and priority, since you have it in front of you?

How does that compare to the phase and priority of the fighter's armor training class special? - In general, weapons and armor are checking their details at different times, so I'd look for an armor-related script to get timing from, rather than a weapon-related script.
Mathias is online now   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old March 25th, 2011, 01:38 PM
EquipType.Armor isn't added to armor until it's been selected.

You can use "component.BaseArmor & !ArmorClass.Shield & !ArmorClass.Tower" if you're looking for things (EquipType.Armor would work if you were looking for the picks on the hero).
Mathias is online now   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old March 25th, 2011, 01:39 PM
Quote:
Originally Posted by unforgivn View Post

~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] = 0)
My guess is this is the problem as that is testing to see if the Class Special is active or not. As a feat is not a Class Special the test will always fail and end the script. Never getting to the later lines of code.

As your using field[abValue].value are you setting a Hard Coded Value.? tag on the feat then? Otherwise if you don't have some other Thing or script setting the value it will just be zero.

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   #4 Reply With Quote
unforgivn
Member
 
Join Date: Dec 2010
Posts: 62

Old March 25th, 2011, 02:23 PM
Quote:
Originally Posted by Mathias View Post
Could you please tell us that phase and priority, since you have it in front of you?

How does that compare to the phase and priority of the fighter's armor training class special? - In general, weapons and armor are checking their details at different times, so I'd look for an armor-related script to get timing from, rather than a weapon-related script.
Pre-levels/5000

Quote:
Originally Posted by Mathias View Post
EquipType.Armor isn't added to armor until it's been selected.

You can use "component.BaseArmor & !ArmorClass.Shield & !ArmorClass.Tower" if you're looking for things (EquipType.Armor would work if you were looking for the picks on the hero).
It doesn't find picks on the hero, either.

Quote:
Originally Posted by ShadowChemosh View Post
My guess is this is the problem as that is testing to see if the Class Special is active or not. As a feat is not a Class Special the test will always fail and end the script. Never getting to the later lines of code.

As your using field[abValue].value are you setting a Hard Coded Value.? tag on the feat then? Otherwise if you don't have some other Thing or script setting the value it will just be zero.
That was actually an old version in my clipboard (apparently I didn't copy the new one like I thought). The references to abValue had been changed to a constant 1.
unforgivn is offline   #5 Reply With Quote
unforgivn
Member
 
Join Date: Dec 2010
Posts: 62

Old March 25th, 2011, 02:35 PM
I changed the timings to match Armor Training, and the bonuses work now. Adding in Mathias' suggested custom expression works, but it shows some things that really shouldn't be choices (Custom/Magic Armor, and other such placeholders). This isn't really a big deal, though.

Can anyone tell me how I should format the if statement to check that the eachpick being looked at is the same as the one chosen? I can't think of any feats or whatnot that use a similar selection method for armor to "borrow" code from.
unforgivn is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old March 25th, 2011, 03:11 PM
Code:
 
field[usrChosen1].chosen.field[arArmorChk].value += 1
field[usrChosen1].chosen.field[arMaxDex].value += 1
no need for a foreach.

Sorry, I forgot about the custom armor. Try adding:

Code:
 
& !Helper.CustomItem & !Helper.Helper
to the end of the expression.
Mathias is online now   #7 Reply With Quote
unforgivn
Member
 
Join Date: Dec 2010
Posts: 62

Old March 25th, 2011, 05:11 PM
Quote:
Originally Posted by Mathias View Post
Code:
 
field[usrChosen1].chosen.field[arArmorChk].value += 1
field[usrChosen1].chosen.field[arMaxDex].value += 1
no need for a foreach.

Sorry, I forgot about the custom armor. Try adding:

Code:
 
& !Helper.CustomItem & !Helper.Helper
to the end of the expression.
Modifying the expression fixes that issue more or less, but replacing the foreach loop with your code results in this error whenever I actually choose anything from the list:



And the bonuses don't work.
unforgivn is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old March 25th, 2011, 06:43 PM
Oops - I forgot, you're looking up a thing, then you need to use that to find all the picks that correspond to it.

Code:
 
var searchexpr as string
searchexpr = field[usrChosen1].chosen.tagids[thingid.?]
 
foreach pick in hero from BaseArmor where searchexpr
  eachpick.field[arArmorChk].value += field[abValue].value
  eachpick.field[arMaxDex].value += field[abValue].value
  nexteach
Mathias is online now   #9 Reply With Quote
unforgivn
Member
 
Join Date: Dec 2010
Posts: 62

Old March 25th, 2011, 08:22 PM
Works now. Thanks.
unforgivn 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 03:49 PM.


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