• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Heirloom weapon trait - [usrChosen1].chosen syntax problem

poilbrun

Member
Hello all
I'm trying to add the Heirloom Weapon trait from Adventurer's Armory in Hero Lab. What the trait does is threefold:
  1. Give a masterwork weapon for the price of a normal one
  2. Make the character proficient with the use of that weapon
  3. Give a +1 Trait bonus on attack rolls with that weapon

I don't care too much if the bonus are for that specific weapon or any weapon of its type, so here is how I resolved it:
  1. Nothing automated, I just create the custom weapon and only pay the amount for a normal weapon
  2. Code:
    var v_tag as string
    v_tag = "Helper.ExoticProf"
    call ChosenProf
  3. That's where I'm stuck. It works if I do:
    Code:
    foreach pick in hero from BaseWep where "IsWeapon.wSwordBast"
      eachpick.field[wAttBonus].value += 1
      nexteach
But of course I would prefer if it gave the bonus to the weapon I chose in the drop-down rather than have to define the weapon in the code. By looking around, I found that I can use [usrChosen1].chosen to get the tag from the dropdown list, but I don't uderstand the syntax I need to use to include it instead of "IsWeapon.wSwordBast".

Can anyone help?
 
Code:
foreach pick in hero from BaseWep where "IsWeapon.wSwordBast"
  eachpick.field[wAttBonus].value += 1
  nexteach
But of course I would prefer if it gave the bonus to the weapon I chose in the drop-down rather than have to define the weapon in the code. By looking around, I found that I can use [usrChosen1].chosen to get the tag from the dropdown list, but I don't uderstand the syntax I need to use to include it instead of "IsWeapon.wSwordBast".

Can anyone help?

Change the above to the following:
Code:
      ~ Add to attacks
      field[usrChosen1].chosen.field[wAttBonus].value += 1
Once the Thing is chosen you can access the fields of the Thing directly. You don't need to go and try and get the thing again.
 
Thank you for your help, but it does not work when I try it...

and thanks also for the data sets on d20pfsrd
 
Last edited:
Phase: Pre-Levels, Priority: 10000

Code:
~if nothing's been chosen, there's nothing we can do
doneif (field[usrChosen1].ischosen = 0)
 
~find the weapon we chose and make it proficient
perform field[usrChosen1].chosen.assign[Helper.Proficient]
 
~add a +1 attack bonus
field[usrChosen1].chosen.field[wAttBonus].value += 1
 
Thank you for your help, but this also does not work. I can use permanent adjustments to solve the issue, so I'll manage until the release of the data set.

By the way, I really appreciate that you tried to help and did not just say that it would be in a future data set. As I'm a new customer, that kind of attitude really comforts me in the belief that I chose the right character generator.
 
I made this for Adventurer's Armory.

Here is the script I used
First Priority 1000
~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

var v_tag as string
v_tag = "Helper.ExoticProf"
call ChosenProf

~ Add to attacks
field[usrChosen2].chosen.field[wAttBonus].value += 1

Eval Rules
Post Attributes Priority 10000

~ If we haven't chosen anything, get out
@valid = 1
doneif (field[usrChosen1].ischosen = 0)

~ Check the attribute requirements for taking an exotic weapon
~ proficiency
var v_req as number
var v_current as number
var v_attr as string
v_req = field[usrChosen1].chosen.tagvalue[StrReq.?]
v_current = hero.child[aSTR].field[aFinalVal].value
v_attr = "Strength"
call fExoticAtt
v_req = field[usrChosen1].chosen.tagvalue[DexReq.?]
v_current = hero.child[aDEX].field[aFinalVal].value
v_attr = "Dexterity"
call fExoticAtt
v_req = field[usrChosen1].chosen.tagvalue[ConReq.?]
v_current = hero.child[aCON].field[aFinalVal].value
v_attr = "Constitution"
call fExoticAtt
v_req = field[usrChosen1].chosen.tagvalue[IntReq.?]
v_current = hero.child[aINT].field[aFinalVal].value
v_attr = "Intelligence"
call fExoticAtt
v_req = field[usrChosen1].chosen.tagvalue[WisReq.?]
v_current = hero.child[aWIS].field[aFinalVal].value
v_attr = "Wisdom"
call fExoticAtt
v_req = field[usrChosen1].chosen.tagvalue[ChaReq.?]
v_current = hero.child[aCHA].field[aFinalVal].value
v_attr = "Charisma"
call fExoticAtt

Trait Category Equipment
Select from All Weapons
Restrict First List To all things
2nd Custom Expression thingid.iMagWeapon
Restrict Second List to all picks on hero
 
Thanks a lot Risner, that works!

Just a note: don't forget to make the weapon Masterwork. I didn't at first, but then it does not appear in the list. It might be worth it to check if it's possible to automatically add a masterwork version of the weapon when you select the feat. I tried with Bootstrap, but you have to choose what you add from the list, so I don't know how you would get the information from the selection field.
 
Back
Top