• 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

Verification Rule Question Regarding Items

AntaresCD

Well-known member
Forgive me if there is an obvious or standard solution to this that I've missed, but here is my situation and question:

I have one category of items for my units that all units have a default limit of 1 of (enforced by exclusion groups and appropriate tags). There is another item that can be taken by some units that raises this limit to 2 but carries the restriction that if they take 2 items from that category they must be different items. The first part is easy (raising the limit) as the exclusion group is tied to a hidden stat and I can just add 1 to the stat. The second part is what I'm having trouble with.

I've explored different ways of trying to enforce different items being taken but they seem too unwieldy or very brute force (and therefore hard to maintain as the list of items in that category grows).

Any ideas or suggestions would be appreciated.

Thanks,

~Antares
 
Forgot to put this in. The "best" solution I've come up with so far is to have a unit level rule that checks to see if the count of any of the tags for the items in this group is greater than 1. It works, but is brute force, like I said. I have the rule automatically validate and exit if the item that raises the limit to 2 is not present, as best practices would dictate.

My problem with this is that every time a new item is added to the group, I have to add another tag count check to this rule.
 
Oh this reminds me, does the scripting in Army Builder use short-circuit evaluation, in general, and, in specific, within if statements (e.g. if there are a string of options or'd together does it stop once one of them is true or does it continue evaluating them all anyway even though the boolean expression has a known answer already by definition)?

This would affect the way I write the script i mentioned above as my current "best" solution to this problem.
 
Oh this reminds me, does the scripting in Army Builder use short-circuit evaluation, in general, and, in specific, within if statements (e.g. if there are a string of options or'd together does it stop once one of them is true or does it continue evaluating them all anyway even though the boolean expression has a known answer already by definition)?

This would affect the way I write the script i mentioned above as my current "best" solution to this problem.

You mean like a exit statement?
Use 'done' I believe that will kick the execution out of the current if block to the next outer block.

The Butcher
 
Back
Top