Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD

Notices

Reply
 
Thread Tools Display Modes
BobStumpp
Junior Member
 
Join Date: Oct 2017
Posts: 13

Old January 16th, 2018, 04:42 PM
I am trying to put together a feat that grants Proficiency for any Non-Heavy weapon. The code is close, but I am missing something

Code:
foreach pick in hero from BaseWep where "!wProperty.Heavy"
  if (eachpick.tagis[Helper.Proficient] = 0) then 
     perform eachpick.assign[Helper.Proficient]
  endif
nexteach
This Eval Script done in Post-Levels works mostly. Once you equip the weapon it shows as you are proficient, and grants the appropriate to hit adjustment. However, if you go to buy a weapon, the Weapons List shows that you are not proficient with some nice red text saying "Not proficient with weapon". But again, once you equip the weapon, it shows that you are proficient.

Any idea as to where/when I should be setting the Proficient tag? Or is there another tag I should be setting?

Thanks,

Bob
BobStumpp is offline   #1 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 596

Old January 17th, 2018, 03:25 AM
Your foreach statement is a Chicken/Egg problem. a weapon doesn't become a "pick" in "hero" until assigned by purchasing it. So what is happening is that you can't become proficient until a weapon has been purchased and becomes part of the hero.

Here's a solution:
Code:
foreach thing in BaseWep where "!wProperty.Heavy"
     ~ grab all weapon proficiency tags from the weapon
     perform eachthing.pulltags[WepProf.?]
nexteach
    
~ Now push all tags to the hero
perform hero.pushtags[WepProf.?]
This foreach statement loops through all things in the BaseWep category without the wProperty.Heavy tag and pulls the Proficiency tags into local memory table.

After it loops through all the weapons, it pushes all the tags it collected out to the hero.
dungeonguru is offline   #2 Reply With Quote
BobStumpp
Junior Member
 
Join Date: Oct 2017
Posts: 13

Old January 17th, 2018, 05:34 AM
Thank you again, that worked perfectly....
BobStumpp is offline   #3 Reply With Quote
Reply

Thread Tools
Display Modes

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:16 AM.


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