• 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

Bug in a Validation Target

wildrage

New member
I seem to have come accross a bug which is preventing me from implementing a validation rule.

The tagcountstr["str"] target does not return the same number as tagcount[exp] when passing the equivalent string/expression. The same issue occurs if I use this.entity.overall.tagcountstr["string"] vs this.entity.overall.tagcount[tag]) from a unit-scope validation rule.

I have a very simple Global Script that does the following:

Code:
if (tagis[Comp.Special] > 0) then
  perform entity.assign[DupTracker.0]
endif

I have added a roster validation rule that does
Code:
debug "tagcount[DupTracker.0]: " & tagcount[DupTracker.0]
debug "tagcountstr[DupTracker.0]: " & tagcountstr["DupTracker.0"]
One would expect the return values to be identical. Unfortunately, this is the output I get from the debug window.
Code:
**********  Start Evaluation Cycle  **********

tagcount[DupTracker.0]: 0
tagcountstr[DupTracker.0]: 0

**********  Start Evaluation Cycle  **********

tagcount[DupTracker.0]: 1
tagcountstr[DupTracker.0]: 1

**********  Start Evaluation Cycle  **********

tagcount[DupTracker.0]: 2
tagcountstr[DupTracker.0]: 1

**********  Start Evaluation Cycle  **********

tagcount[DupTracker.0]: 3
tagcountstr[DupTracker.0]: 1
The Debug Roster Accrued Tags windows shows that the DupTracker.0 tag does have a count of 3. The validation I want to implement absolutely has to be done with tagcountstr[] because the tag that needs to be counted is dynamic.

Is there a workaround?
 
Last edited:
That does look like a bug. Can you send me the data files you're using so I can investigate the problem and hopefully fix it in AB3.3? Please email them to me at colen@wolflair.com with information on how to reproduce the problem.

As a workaround, is there a limited number of tags that you'll need to be checking? It'd be ugly, but you could do something like this:

Code:
if (somenumber = 0) then
  value = tagcount[DupTracker.0]
elseif (somenumber = 1) then
  value = tagcount[DupTracker.1]
elseif (somenumber = 2) then
  value = tagcount[DupTracker.2]
.. etc etc ..

Hope this helps!
 
Back
Top