• 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

Inheriting Rules

toddp

Active member
I am working on the Warmaster Ancients data files. I need to specify several unit restrictions, such as minimum 2 units per 1000 points, etc.

These restrictions encompass minimum 1, 2, 4, 8 and equivalent maximums.

In the past, there was the umin and umax directives. Previously, Army Builder 2.0, I was able to specify some generic text for several options and then inherit the restrictions and the text for each army list.

In Army Builder 3.0, it appears that the rule specification is associated only at the roster level. For example, if I have two units with a unit minimum, I have to write two rules. One to validate unit1 and a second for unit2.

I would like to define an option with a name like min2 and then evaluate the rule for min2 for each unit, by linking min2 to each unit.

Does anyone have any suggestions?

Regards,

Todd
 
Have a look at the tips and tricks section of the doco - Check out the Merge Rules section. I think that's what you're after.
 
Tried it out. This seems to work for maximums, but not for minimums.

For example, I started out testing the rule for Generals. There can be one and only one General. I wrote this merge scope rule:

if (tagvalue[misc.limitJust1] = 0) then
if (tagvalue[misc.limitmin?] > 0) then
@valid = 1
done
endif
else
~ limitJust1 is > 0
if (count[unit] = 1) then
@valid = 1
done
endif
endif


limitJust1 is the rule for the general. limitmin2 is a rule for another unit.

This rule is not evaluated for the empty roster. I have to add a unit before the merge rules will take effect.

How are you structuring minimums in your datafiles?
 
I slept on it. Generals may be a bad example, because every army has to have one. However, most armies have specific units which need to be included. Hence, merge rules would be perfect for this. However, they do not seem to be evaluated when the roster does not include one of these units -- exactly the wrong solution for the minimums.


A possible solution would be to use a global tag and roster rule would go off saying that a unit is required at a specific minimum. Next, a specific minimum tag and merge rule to evalate all of the minimums and maximums.

Am I thinking along the correct lines? I was hoping only to define one tag (because I am fundamentally lazy) but two tags would get the job done and be more maintainable than specific rules for every army.

Comments and recommendations are completely welcome.

Regards,

Todd
 
At 10:27 AM 12/6/2005 -0500, you wrote:
>I slept on it. Generals may be a bad example, because every army has
>to have one. However, most armies have specific units which need to
>be included. Hence, merge rules would be perfect for this. However,
>they do not seem to be evaluated when the roster does not include
>one of these units -- exactly the wrong solution for the minimums.
>
>
>A possible solution would be to use a global tag and roster rule
>would go off saying that a unit is required at a specific minimum.
>Next, a specific minimum tag and merge rule to evalate all of the
>minimums and maximums.
>
>Am I thinking along the correct lines? I was hoping only to define
>one tag (because I am fundamentally lazy) but two tags would get the
>job done and be more maintainable than specific rules for every army.


I'm not sure that merge rules would be so good for limiting minimums
- since, as you've seen, they don't get evaluated when there are none
of the unit in the roster.

For imposing a minimum limit, why not just use a roster scope rule?
All it needs to do is check that the minimum number of 'I am the
general' tags are present in the entire roster, and it can work out
validity based on that. As long as the tag group with the 'general'
tag is marked as accrued, the rule can see it - you don't need to use
global tags at all.

I don't think a merge scope rule is appropriate for calculating
minimum entity counts - for maximums it definitely is. :)


Hope this helps,



--
Colen McAlister (colen@wolflair.com)
Chief Engineer, Lone Wolf Development
http://www.wolflair.com/
 
I've been playing with this for a bit now. I realized that General was a bad example. The issue is with most units in the ruleset have specific maximums depending upon the race.

In some ways, I was hoping to use a common mechanism for both minimums and maximums. This would reduce the maintenance on the files. This helps provide some consistency in the output and less work for me (did I mention that I'm lazy?).

For the roster scope rules to work for each army, I have to add a tag and a rule to each army. Given that I have to do that much work, then I may as well use this roster tag for checking the minimum for each unit -- skip the merge rules entirely for minimums. Although, I still like the symmetry...

I'll let you know. Thank you for the help.

Regards,

Todd
 
You do NOT need to add your own custom tags for tracking min/max details. Instead, you can use the "identity" tag that can be automatically generated by AB. By designating a unit as having an "identity" tag, an appropriate tag is created by AB and added to the roster for every instance of that unit in the roster. The tag is implicitly defined as "accrued", so you'll readily have the total number of tags of a given type available. No additional tags need to be defined.

To determine maximums for the roster, the "merge" scope is the optimal mechanism to use. For units that have a maximum, you can define a "limit" tag with the appropriate limit, and the merge rule can impose the proper limit based on that tag. There is a detailed example of how to do this within the Kit docs.

For minimums, the only rules that will always fire are those with "roster" scope. All other rules are fired only for each instance of the corresponding scope. That means that a rule with "merge" scope will be evaluated for every unique unit in roster, but an empty roster will have nothing to evaluate. So you need to define rules with "roster" scope in order to enforce minimums. There is no way to write a generic rule that tests an arbitrary number of conditions, so you'll either need to write a separate rule for each requirement or a smaller number of rules that each monitor multiple requirements. Since "minimum" rules are not that prevalent, this shouldn't be too much work.

Hope this helps,
Rob

At 09:14 PM 12/6/2005, you wrote:

I've been playing with this for a bit now. I realized that General was a bad example. The issue is with most units in the ruleset have specific maximums depending upon the race.

In some ways, I was hoping to use a common mechanism for both minimums and maximums. This would reduce the maintenance on the files. This helps provide some consistency in the output and less work for me (did I mention that I'm lazy?).

For the roster scope rules to work for each army, I have to add a tag and a rule to each army. Given that I have to do that much work, then I may as well use this roster tag for checking the minimum for each unit -- skip the merge rules entirely for minimums. Although, I still like the symmetry...

I'll let you know. Thank you for the help.

Regards,

Todd
 
Thank you all very much for your help. I wanted to respond with the method that appears to work the best (at least for me).

1. Add id tag to all of my units, results in unitid.xxx generated for each unit.
2. Add a minimum rule to each army for each minimum unit. This rule only checks for the existence of the unit in the roster. This is a roster level rule. No real logic other than to say, archers are required.
3. Using a tag called limits.min2, limits.min4, etc. define tags for each size of minimum or max2, max4 for each size of maximum. These are defined in the data definition file in the groups.
4. Add a set of merge rules to my generic data file. These rules check that the unit count (actually model count in my case) meets a specific criterion. I would like to have one rule do everything, but I want to print out a meaningful value. I could not find a way to pass a numeric value into the message field. For example, the merge rule for limits.min2, states "2 units required."

When the user starts up the list, these validation messages appear:
Archers are required.
Infantry is required.

When the user places units of Archers and Infantry in the list, these validation messages appear:
Infantry: 2 units per 1000 points.
Archers: 4 units per 1000 points.


If you have been following the thread, Generals are required in every army. I solved this with my tag for unit types. The General unit type tag: UnitType.General is validated within my generic data file as a roster level rule:

if (tagcount[UnitType.General] = 1) then
@valid = 1
endif


Enforcing one general per army is required.


Thank you all for your help getting me through a tough learning curve.


Regards,

Todd
 
Forgot to add one other important item.

This makes the output for minimums and maximums the same without a lot of maintenance. I have to maintain only a handful of rules but automatically get the text for them, by attaching the appropriate tags.

Regards,

Todd
 
Back
Top