• 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

I'm back with more questions

New question. I am making a class that only gets proficiency with light shields, not heavy ones. The code I am trying to use and which is not working quite right is....

First (Users), 10000
var result as number
foreach pick in hero where "ShldClass.Light"
result = each.assign[Helper.Proficient]
nexteach

The only problem here is that the character is not showing as proficient, so when they go to buy a light shield it is grayed out. Any better way to do this?
 
try this:

foreach thing in Armor where "ShldClass.Light"
perform eachthing.assign[Helper.Proficient]
nexteach
foreach pick in hero where "ShldClass.Light"
perform eachpick.assign[Helper.Proficient]
nexteach

Until an item is added to your hero - while you're seeing it in the purchase form - it's called a "thing". Once added to the hero, it becomes a "pick". So, your loop was searching through all the picks on the hero to find the light shields you own. So, add a second loop to find all the shield things as well. The exact details of a search through things differ slightly from searching picks.

One thing to check before doing that is to make sure that once you purchase a light shield, but not a heavy shield, it's properly proficient with your old script. If that doesn't work, then something else is going wrong.
 
foreach thing in BaseArmor where "ShldClass.Light"
perform eachthing.assign[Helper.Proficient]
nexteach
foreach pick in hero where "ShldClass.Light"
perform eachpick.assign[Helper.Proficient]
nexteach

Now I get the error "Syntax error in 'eval' script for Thing 'fArmLgShld' (Eval script '#1') on line 2
-> Script reference is invalid under the circumstances"

What circumstances? Is it because I am doing it through an Eval Script? Should I do it as an Eval Rule Instead? ... No that didn't work either.

Thanks for all your help, by the way, mgehl.
 
Question - does the original script you wrote make the light shields but no the heavy shields proficient once they're purchased?

Is that good enough?
 
OK, now I'm remembering - you can't assign tags to a thing, only a pick.

I tested your original script - it does make them proficient once added, and looking at how the prereq is constructed, you'd need access to the structural files to create the tests that would look for a light shield tag.

I can't think of another way to do this.
 
Ah. Thanks anyway. This will be good enough I suppose, I've no desire to go mucking about in the structural files.
 
Back
Top