Junior Member
Join Date: Oct 2017
Posts: 13
|
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 Any idea as to where/when I should be setting the Proficient tag? Or is there another tag I should be setting? Thanks, Bob |
#1 |
Senior Member
Join Date: May 2016
Posts: 608
|
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.?] After it loops through all the weapons, it pushes all the tags it collected out to the hero. |
#2 |
Junior Member
Join Date: Oct 2017
Posts: 13
|
Thank you again, that worked perfectly....
|
#3 |
|
|