• 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

Quick question about rules and army design

Ragnoff

Member
Working on new files for warhamer fantasy 8th and I have a question. i am a relatively inexperienced coder trying to learn more about ABCreator and the various files.

Units designated by tag as belonging to the "Special" or "Rare" groups can be duplicated a limited number of times based on point size of the army. On race does not have that limit (which should be easy to check with an if then statement). Currently we are writing a rule in each race data file for each individual unit, checking for duplicates and making sure the number is less than the required amount.

This seems the more cumbersome way of doing this. Shouldn't there be a way to generalize or globalization this? Could we check within all units with the "special" tag and count the number of times each unit id appears? I assume this would be done as each unit is added or subtracted (that is "top-level Done, correct?)

Any advice would be appreciated, as these files have been through several versions they have become a bit of a mess and I would like to clean them up if possible.
 
I *think* you should be able to do this with a merge-scope validation rule. Here's what you can try:

1) Create a validation rule, set to "merge" scope.

2) Set the test expression to "Comp.Special" or whatever the appropriate tag is, so that it only applies to Special units.

3) Use the following code for the script:
Code:
if (count[unit] <= 3) then
  @valid = 1
  endif
(Assuming that you can have 3 or less of each Special unit)

I *think* this should validate that each individual special unit can be taken up to 3 times, but let you take as many different units as you like.

Let me know if this works - if not, I'll investigate further.
 
Back
Top