• 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

Need help with a feat

I am creating a custom feat that allows a player to choose one of two skills and add proficiency in it if they are not or double their proficiency if they are i have tried, to figure out the script myself and i can get it to work if for the proficiency if i allow them to pick from all skills, so i need to know how to limit the list and how to add the double proficiency, any help is appreciated. I have tried to copy the scripting from the Dwarven Tool Proficiency and change it to skills but it wont limit the selections, properly.
 
I've been playing with it, and I'm almost at 90% working - I can't seem to get the timing right on this code for it to work.

Your feat has to have
Checkmark on Show Selection Options on the In-Play Tab?
SelectFfrom -> Skills
Restrict First List To... -> All things
Second Selection From -> Skills
Restrict Second List To ... -> All things

Eval script will be similar to this timing should be post-levels
Code:
doneif (tagis[Helper.ShowSpec] = 0)
doneif (tagis[Helper.Disable] <> 0)
var tagall as string
if (field[usrChosen1].ischosen <> 0) then
~ grab all tags from the chosen pick
  tagall = field[usrChosen1].chosen.tagids[ProfSkill.?," | "]
  foreach pick in hero from BaseSkill where tagall
    if (eachpick.tagis[Helper.Proficient] = 0) then 
      perform eachpick.assign[Helper.Proficient]
    else
      perform eachpick.assign[Helper.ProfDouble]
    endif
  nexteach 
endif
      
if (field[usrChosen2].ischosen <> 0) then
~ grab all tags from the chosen pick
  tagall = field[usrChosen2].chosen.tagids[ProfSkill.?," | "]
  foreach pick in hero from BaseSkill where tagall
    if (eachpick.tagis[Helper.Proficient] = 0) then 
      perform eachpick.assign[Helper.Proficient]
    else
      perform eachpick.assign[Helper.ProfDouble]
    endif
  nexteach 
endif

It's granting the proficiency, but it never wants to fire off for the double proficiency. Any scripters out there want to chime in?
 
Code:

doneif (tagis[Helper.ShowSpec] = 0)
doneif (tagis[Helper.Disable] <> 0)
var tagall as string
if (field[usrChosen1].ischosen <> 0) then
~ grab all tags from the chosen pick
tagall = field[usrChosen1].chosen.tagids[ProfSkill.?," | "]
foreach pick in hero from BaseSkill where tagall
if (eachpick.tagis[Helper.Proficient] = 0) then
perform eachpick.assign[Helper.Proficient]
else
perform eachpick.assign[Helper.ProfDouble]
endif
nexteach
endif
if (field[usrChosen2].ischosen <> 0) then
~ grab all tags from the chosen pick
tagall = field[usrChosen2].chosen.tagids[ProfSkill.?," | "]
foreach pick in hero from BaseSkill where tagall
if (eachpick.tagis[Helper.Proficient] = 0) then
perform eachpick.assign[Helper.Proficient]
else
perform eachpick.assign[Helper.ProfDouble]
endif
nexteach
endif

I think the problem is in the lack of another tagis, maybe try this:

Code:

doneif (tagis[Helper.ShowSpec] = 0)
doneif (tagis[Helper.Disable] <> 0)
var tagall as string
if (field[usrChosen1].ischosen <> 0) then
~ grab all tags from the chosen pick
tagall = field[usrChosen1].chosen.tagids[ProfSkill.?," | "]
foreach pick in hero from BaseSkill where tagall
if (eachpick.tagis[Helper.Proficient] = 0) then
perform eachpick.assign[Helper.Proficient]
elseif (eachpick.tagis[Helper.Proficient] <> 0) then
perform eachpick.assign[Helper.ProfDouble]
endif
nexteach
endif
if (field[usrChosen2].ischosen <> 0) then
~ grab all tags from the chosen pick
tagall = field[usrChosen2].chosen.tagids[ProfSkill.?," | "]
foreach pick in hero from BaseSkill where tagall
if (eachpick.tagis[Helper.Proficient] = 0) then
perform eachpick.assign[Helper.Proficient]
elseif (eachpick.tagis[Helper.Proficient] <> 0) then
perform eachpick.assign[Helper.ProfDouble]
endif
nexteach
endif
 
No, that doesn't work. The problem is really timing and I found a "fix".

In Post-Levels/15000 Component BaseSkill: Assign Helper.Proficient based on ProfSkill tags on Hero runs and that Component call assigns all the pending Helper.Proficient tags (chosen in other areas).

then at Post-Levels/20000 Calc skProfBon runs which checks for all the Helper.Proficient skills and updates the field values to be displayed correctly.

So I find that the script for this feat has to shoehorn in at Post-Levels/15001 up to Post-Levels/19999 before Calc skProfBon runs in order for it to check if someone already has a proficiency selected elsewhere.

The other problem I'm seeing is what do you *davystyles* want to do if the skill already has double proficiency? Just ignore or are you planning on granting advantage?
 
Hey DungeonGuru... I think it's time we crown you the 5e HL Code Expert :) Really appreciate having someone around here who's focused on 5e and understands the complexities of Hero Lab :) Thanks mate.
 
probably just gonna ignore it if i want to grant advantage i can put that in the general description, sorry for not getting back to you guys quicker been prepping for Hurricane Irma, the code works great i want to limit the selection of the skill to two skills and they choose one, they are also choosing and attribute to add 1 to, i have the code for the attribute and have the selction box for theat i cant get the selection box for the skills to limit the selection
 
Last edited:
sorry for not getting back to you guys quicker been prepping for Hurricane Irma

Wish you the best of luck, hurricanes and real life always take precedence.

, the code works great i want to limit the selection of the skill to two skills and they choose one, they are also choosing and attribute to add 1 to, i have the code for the attribute and have the selction box for theat i cant get the selection box for the skills to limit the selection

Usually to narrow down to two things, you need to ignore the 1st/2nd Selection From box and make a Custom Expression.

For skills it will look something like (component.BaseSkill & (thingid.skAnimHand | thingid.skArcana))

That expression limits the dropdown to things in the base skill set and have an ID on them that are Animal Handling or Arcana. The parentheses are important here. The second set of parentheses around the skill define the list in the dropdown more than anything.

You could also make an Array based menu, but then you have to know how to manipulate things by using the index number of the array, which a bit more tricky but you control things like sort order since you entered the array.
 
Back
Top