Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Army Builder Forums > Army Builder
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
InquisitorValdez
Junior Member
 
Join Date: Aug 2005
Posts: 19

Old March 11th, 2006, 08:50 PM
I am attempting to write a data file that can only contain up to one entity of unique ID Gate. When writing a validation rule for this I am encoutnering problems.
I have tried using both unit and item entities called Gate and assigned a tag of Spec.Gate. Then I used the following code in a validation rule of scope roster:

if (tagcount[Spec.Gate] <= 1) then
@valid = 1
endif


Army Builder then compiles this, but no validation error occurs if two or more Gates are included.

Then i tried using the following (obviously swapping unit for item depending upon which entity type I was using):

var x as number
x = tally[unit:Spec.Gate&convert.validate]
if (x <= 1) then
@valid = 1
endif



However Army Builder is still not returning a validation error when 2 Gates are selected.

Has anyone got any advice for me because I seem to be hitting a brick wall.
InquisitorValdez is offline   #1 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old March 12th, 2006, 12:37 AM
You were almost correct with your first attempt. The one thing you omitted was designating the tag group to be "accrued". If you don't do this, the tag is assigned to the entity and that's the only place it will be found. However, if you DO mark the group as "accrued", the tags from that group will be propogated to their container(s) and the overall roster. Once you do that, your rule below should work.

The use of accrued tags is critical in many data files. I recommend you review the docs on accrued tags so that you fully understand how they can be used. There's a LOT to digest for writing AB data files, and this is one topic that warrants a re-read due to its importance. :-)

Also, there are a bunch of debugging aids within AB that can help you to determine what the source of a problem actually is. For example, you could use the aids for viewing tags to verify that the tag was showing up for the entities but not for the overall roster. This could eliminate the rule as the source of the problem and help focus in on the true source. For more details, see the "Getting Started" chapter in the Kit docs and refer to the "Debugging Tools Within Army Builder" section.

Hope this helps,
Rob

At 09:50 PM 3/11/2006, you wrote:

Quote:
I am attempting to write a data file that can only contain up to one entity of unique ID Gate. When writing a validation rule for this I am encoutnering problems.
I have tried using both unit and item entities called Gate and assigned a tag of Spec.Gate. Then I used the following code in a validation rule of scope roster:

if (tagcount[Spec.Gate] <= 1) then
@valid = 1
endif

Army Builder then compiles this, but no validation error occurs if two or more Gates are included.

Then i tried using the following (obviously swapping unit for item depending upon which entity type I was using):

var x as number
x = tally[unit:Spec.Gate&convert.validate]
if (x <= 1) then
@valid = 1
endif


However Army Builder is still not returning a validation error when 2 Gates are selected.

Has anyone got any advice for me because I seem to be hitting a brick wall.
rob is offline   #2 Reply With Quote
InquisitorValdez
Junior Member
 
Join Date: Aug 2005
Posts: 19

Old March 12th, 2006, 12:17 PM
Excellent. Thanks for that. this is what happens when you plow ahead without fully understanding the documentation!

Hopefully there won't be many more problems!
InquisitorValdez is offline   #3 Reply With Quote
Reply


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 12:28 PM.


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