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
davystyles
Junior Member
 
Join Date: Aug 2017
Posts: 13

Old September 3rd, 2017, 07:28 AM
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.
davystyles is offline   #1 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old September 7th, 2017, 09:34 AM
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?
dungeonguru is offline   #2 Reply With Quote
DeltaMasterMind
Senior Member
 
Join Date: Jul 2014
Posts: 412

Old September 7th, 2017, 11:19 AM
Quote:
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

Forum link for my content work:
Pathfinder Thread
Forum link for SU 5e content work:
5e Steven Universe Thread
This link is for my group, but feel free to play it with:
DMM 5e | "https://www.dropbox.com/s/vsd9w1eodlnwjq0/updatesDMM.xml?dl=1" Copy this link to your update manager to get updates when available.
This adds the Pisky subrace to elves from Berserk! and additional subraces for the Gem Race.
Please post comments in the provided threads above.
DeltaMasterMind is offline   #3 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old September 7th, 2017, 03:31 PM
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?
dungeonguru is offline   #4 Reply With Quote
daplunk
Senior Member
 
Join Date: Jan 2016
Location: Adelaide, Australia
Posts: 2,294

Old September 7th, 2017, 04:24 PM
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.

Realm Works - Community Links
Realm Work and Hero Lab Videos
Ream Works Facebook User Group
CC3+ Facebook User Group

D&D 5e Community Pack - Contributor
General Hero Lab Support & Community Resources
D&D 5e Community Pack - Install Instructions / D&D 5e Community Pack - Log Fault / D&D 5e Community Pack - Editor Knowledge Base

Obsidian
Obsidian TTRPG Tutorials
daplunk is offline   #5 Reply With Quote
davystyles
Junior Member
 
Join Date: Aug 2017
Posts: 13

Old September 7th, 2017, 08:00 PM
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 by davystyles; September 7th, 2017 at 08:48 PM.
davystyles is offline   #6 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old September 8th, 2017, 04:08 AM
Quote:
Originally Posted by davystyles View Post
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.

Quote:
Originally Posted by davystyles View Post
, 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.
dungeonguru is offline   #7 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 06:28 AM.


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