Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   Army Builder (http://forums.wolflair.com/forumdisplay.php?f=16)
-   -   Verification Rule Question Regarding Items (http://forums.wolflair.com/showthread.php?t=49412)

AntaresCD May 22nd, 2014 11:58 AM

Verification Rule Question Regarding Items
 
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

AntaresCD May 22nd, 2014 12:16 PM

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.

AntaresCD May 22nd, 2014 12:20 PM

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.

thebutcher June 2nd, 2014 08:47 PM

Quote:

Originally Posted by AntaresCD (Post 183711)
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


All times are GMT -8. The time now is 03:24 PM.

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