Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
At the moment my campaign is the Age of worms, in it this feat has cropped up and I am trying to get it into hero lab however I can script it so it works with all the pre reqs assigned but I don't know how to check for one handed Slashing weapons only on the Weapon Focus feat.
I've ticked the Restrict to picks on hero and select from all weapons but how can I restrict it to only show one handed Slashing weapons only? Code:
{b}Prerequisites{/b}: Weapon finesse, Weapon Focus (Any one handed Slashing Weapon), Base Attack Bonus +1. {b}Benefit{/b}: If you do not wield a shield or weapon in your off-hand you treat your chosen weapon as a light weapon. If you do not wield a shield or weapon in your off-hand, you also gain a +1 shield bonus to your AC while wielding your chosen weapon. When you are fighting defensively or using the total defense action, this shield bonus increases to +2 {b}Special{/b}: A fighter may select Improved Buckler Defense as one of his fighter bonus feats. You may take this feat more than once, each time you do, it applies to a new one-handed slashing weapon you have weapon focus in. {b}{i}Age Of Worms Feat{/i}{/b} Code:
Eval script ~ If we're disabled, do nothing if (tagis[Helper.FtDisable] <> 0) then done endif ~ If we're wearing armor or wearing a Buckler, we're disabled. if (hero.tagis[Hero.EquipArmor] + hero.tagis[Hero.EquipShld] <> 0) then var result as number result = assign[Helper.SpcDisable] done endif ~ Check to see if we have something equipped in main hand only if (hero.tagis[Hero.EquipMain] < 1) then done endif ~ Check to see that we dont have at two weapons equipped, or a double ~ weapon if (hero.tagcount[Hero.EquipWep] > 1) then done endif ~ Check to see if our Unarmed Strike is selected in either main or off ~ hands if (hero.child[wUnarmed].tagis[Hero.MainHand] + hero.child[wUnarmed].tagis[Hero.OffHand] < 0) then done endif ~ Otherwise, add a +1 Shield bonus to our AC hero.child[ArmorClass].field[tACShield].value = maximum(hero.child[ArmorClass].field[tACShield].value, 1) |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
In this case, you'll need a custom expression for selection. First, add a couple of weapons, and look at their tags until you've figured out that one handed is the wClass.OneHanded tag, and slashing is the wType.Slashing tag.
So, you don't want anything in "Select From". In "Custom Expression", you'll need a search string which finds things which are weapons, and are one-handed and slashing. Looking at the code for "Select From...Weapons" (which isn't something you'd have available), the custom expression it generates is: Code:
component.BaseWep & !Helper.NoSelect & !component.Specific & !wCategory.Ammunition Starting with that, & on the tags we need: Code:
component.BaseWep & !Helper.NoSelect & !component.Specific & !wCategory.Ammunition & wClass.OneHanded & wType.Slashing Code:
component.BaseWep & !Helper.NoSelect & !component.Specific & !wCategory.Ammunition & wClass.OneHanded & wType.Slashing & Broadcast.WepFocus |
#2 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
I tried adding this to the custom expression but I keep getting this error message.
"existence tagexpr for pick 'fGracEdge' is scheduled after primary condition test is scheduled' I've tried changing the timing from pre levels to post levels to final phase users but to no avail. However if I don't add Graceful edge as a Bonus feat it displays correctly in the feat panel but when i try to select the weapon "Scimitar" the pick box says "Nothing to Select!" So if added as a fighter bonus feat I get the error former error, but if added as a normal feat i get the "Nothing to select!" error? Restrict to Picks on hero ticked, Select from... None allocated. Quote:
Last edited by bodrin; March 9th, 2009 at 10:28 AM. |
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
It's probably the bonus feat part that's causing your timing problem. Do you have a condition expression for the bootstrap that's placing the feat on your character? If so, move its timing back. First, 10000 usually works (and, since a version or two ago, that's been the default (the default used to be First, 100)).
If you want to test for weapon focus, you'll need to have "restrict to...picks on hero" selected, and then the script will only find the weapons your hero owns - because the weapon focus feat can't put a tag on something that hasn't been added yet. So, you'll have to buy a scimitar before that will work. If you want to enforce the restriction on weapon focus with the pre-req or an eval rule, you can go with the previous tag expression I gave you, and not restrict the picks available. |
#4 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
Quote:
Bootstrap? I haven't messed around with scripting a bootstrap and I wouldn't know how to, any tips on Bootstraps and their uses greatly appreciated. I've only added the feat via the eval scripts whilst copying similar feats and changing the relevant data. Last edited by bodrin; March 11th, 2009 at 03:33 AM. |
|
#5 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
Quote:
This is the custom expression next to Restrict to picks on hero. It's pasted directly into the field. Code:
component.BaseWep & !Helper.NoSelect & !component.Specific & !wCategory.Ammunition & wClass.OneHanded & wType.Slashing & Broadcast.WepFocus Code:
~ If we're disabled, do nothing if (tagis[Helper.FtDisable] <> 0) then done endif ~ If we're wearing armor or wearing a Buckler, we're disabled. if (hero.tagis[Hero.EquipArmor] + hero.tagis[Hero.EquipShld] <> 0) then var result as number result = assign[Helper.SpcDisable] done endif ~ Check to see if we have something equipped in one hand if (hero.tagis[Hero.EquipMain] < 1) then done endif ~ Check to see that we don't have two weapons equipped, or a double ~ weapon if (hero.tagcount[Hero.EquipWep] > 1) then done endif ~ Check to see if our Unarmed Strike isn't selected in either main or off ~ hands if (hero.child[wUnarmed].tagis[Hero.MainHand] + hero.child[wUnarmed].tagis[Hero.OffHand] < 0) then done endif ~ Otherwise, add a +1 Shield bonus to our AC hero.child[ArmorClass].field[tACShield].value = maximum(hero.child[ArmorClass].field[tACShield].value, 1) |
|
#6 |
|
|