Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Palgar
Junior Member
 
Join Date: Nov 2013
Posts: 8

Old January 24th, 2020, 10:22 PM
Using the Editor, I'm trying to create a feat that will allow the user to pick two skills that they are proficient in and modify them. The dropdowns to display the proficient skills always show all skills, not just the proficient ones.

My setup:
Select From... Skills
Custom Expression Helper.Proficient
Restrict List To All Picks on Hero

What am I doing wrong here?
Palgar is offline   #1 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old January 25th, 2020, 07:03 AM
There's an issue with timing here that's not evident when you use the normal custom expression field to do the dirty work.

You'll want to look at the scripts hanging off of something like the Rogue Expertise to build the custom expression.

Script #2 in the rogue expertise feature runs at Final 999999 timing and builds the candid expressions for picking two skills that you're proficient at.

Code:
      var tagexpr as string
      foreach pick in hero from BaseSkill where "Helper.Proficient"
        perform eachpick.pulltags[ProfSkill.?]
        nexteach

      if (tagis[ProfSkill.?] <> 0) then
        tagexpr = "(component.BaseSkill & (" & tagids[ProfSkill.?, " | "] & ")) | thingid.gTooThieve"
      else
        tagexpr = "thingid.gTooThieve"
        endif

      field[usrCandid1].text = tagexpr
      field[usrCandid2].text = tagexpr
Now, this includes adding Thieves' tools to the list so you can drop it out. but this would build your dropdown lists correctly. It also shows you how you're going to have to add tool proficiencies if you want to include those.

Script #1 on the same Expertise has the code that modifies the skills to be double proficiency, you can change the code all you want to just add bonuses or have it note advantage, ect. This runs at Post-Levels 10000

Code:
      doneif (tagis[Helper.ShowSpec] = 0)

      doneif (tagis[Helper.Disable] <> 0)

      var tagexpr as string

      if (field[usrChosen1].ischosen <> 0) then
        tagexpr = field[usrChosen1].chosen.tagids[ProfSkill.?," | "]
        foreach pick in hero from BaseSkill where tagexpr
          perform eachpick.assign[Helper.ProfDouble]
          nexteach

        ~If we've got proficiency with our thieves' tools, we need to display
        ~ on the characer sheet/special tab
        if (field[usrChosen1].chosen.tagis[thingid.gTooThieve] <> 0) then
          perform delete[Helper.SpecUp]
          field[livename].text = field[thingname].text & " (Thieves's tools)"
          perform hero.assign[ProfTooDbl.gTooThieve]
          endif
        endif

      if (field[usrChosen2].ischosen <> 0) then
        tagexpr = field[usrChosen2].chosen.tagids[ProfSkill.?," | "]
        foreach pick in hero from BaseSkill where tagexpr
          perform eachpick.assign[Helper.ProfDouble]
          nexteach

        ~If we've got proficiency with our thieves' tools, we need to display
        ~ on the characer sheet/special tab
        if (field[usrChosen2].chosen.tagis[thingid.gTooThieve] <> 0) then
          perform delete[Helper.SpecUp]
          field[livename].text = field[thingname].text & " (Thieves's tools)"
          perform hero.assign[ProfTooDbl.gTooThieve]
          endif
        endif
dungeonguru is offline   #2 Reply With Quote
Palgar
Junior Member
 
Join Date: Nov 2013
Posts: 8

Old January 26th, 2020, 12:22 AM
That's what I was looking for and it works exactly as I need. So, when is the custom expression used, or must we always override it in a script?
Palgar is offline   #3 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old January 26th, 2020, 09:18 AM
The "default" custom expression can be used for a lot of things, you can poke around the community files and see examples. Usually these have to do with simple things like energy resistance and such.

Since using those dropdown fields always require a script or a conditional statement to push tags or enable bootstraps, you'll see a lot of contributors will often build their expression in the script itself rather than rely on the basic field.

It's something that you'll get a feel for after you've done it for a while.
dungeonguru is offline   #4 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 12:35 PM.


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