• 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

Help with Weapon focus (slashing) pre-req

Lawful_g

Well-known member
Here is what I am trying, but it is not working. Normally I'd fiddle around with the phase, but that is not an option with Pre-requisites, so it must be some error in my code.

~ Loop through all weapons with weapon focus
var result as number
foreach pick in hero where "Broadcast.WepFocus"

~ If one has slashing, add one.
if (each.tagis[wType.S] <> 0) then
result += 1
endif
nexteach

if (result >= 1) then
@valid = 1
endif
 
Broadcast.WepFocus is added to the hero as well as the weapon. You'll need to restrict your search to finding weapons.

Code:
foreach pick in hero from BaseWep where "Broadcast.WepFocus & wType.S"
result += 1
nexteach
 
validif (result >= 1)

Note: before the "from XXX" restriction was available, you'd have written:

Code:
foreach pick in hero where "component.BaseWep & Broadcast.WepFocus & wType.S"
"from XXX" should be used in foreach if you can restrict your search to a single component - foreach is one of the most time-consuming operations in Hero Lab, so restricting the number of things it searches for is always good.

The other problem might be that there needs to be a copy of the weapon you have focus for on the character before this prereq can find something to test, so you'll have to buy a copy for your test character.

In the future, please remember to describe the error - you didn't say what was going wrong with your prereq - always valid, always invalid, valid/invalid for the wrong things?
 
Back
Top