Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Army Builder Forums > Army Builder

Notices

Reply
 
Thread Tools Display Modes
AntaresCD
Senior Member
Volunteer Data File Author
 
Join Date: Oct 2011
Posts: 121

Old May 22nd, 2014, 10:58 AM
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

My code doesn't have bugs; it has undocumented features!
AntaresCD is offline   #1 Reply With Quote
AntaresCD
Senior Member
Volunteer Data File Author
 
Join Date: Oct 2011
Posts: 121

Old May 22nd, 2014, 11:16 AM
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.

My code doesn't have bugs; it has undocumented features!
AntaresCD is offline   #2 Reply With Quote
AntaresCD
Senior Member
Volunteer Data File Author
 
Join Date: Oct 2011
Posts: 121

Old May 22nd, 2014, 11:20 AM
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.

My code doesn't have bugs; it has undocumented features!
AntaresCD is offline   #3 Reply With Quote
thebutcher
Senior Member
Volunteer Data File Author
 
Join Date: Apr 2005
Posts: 220

Old June 2nd, 2014, 07:47 PM
Quote:
Originally Posted by AntaresCD View Post
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

Warmachine/Hordes ('Retired' Confrontation and AT-43) Army Builder Author.
Magic the Gathering Card Vault Author.
thebutcher is offline   #4 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:09 AM.


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